- Sync up patches with ArchLinux:

+ Added 0001-Remove-unused-DEPRECATED-macro.patch
  + Added 0002-Conditionally-define-g_info-macro.patch
  + Added 0003-Add-kuid_t-kgid_t-compatibility-layer.patch
  + Added 0004-Use-new-link-helpers.patch
  + Added 0005-Update-hgfs-file-operations-for-newer-kernels.patch
  + Added 0006-Fix-vmxnet-module-on-kernels-3.16.patch
  + Added 0007-Fix-vmhgfs-module-on-kernels-3.16.patch
  + Added 0008-Fix-segfault-in-vmhgfs.patch
  + Droped g_info_redefine.patch (now named
    0002-Conditionally-define-g_info-macro.patch).
- Enable building of KMP packages.
- Fix bashisms in preun script.
- Do not generate timestamps in the doxygen docs.

OBS-URL: https://build.opensuse.org/package/show/Virtualization:VMware/open-vm-tools?expand=0&rev=267
This commit is contained in:
Dominique Leuenberger 2014-11-10 16:06:43 +00:00 committed by Git OBS Bridge
parent 6603050a7b
commit de200b6f0e
11 changed files with 3413 additions and 25 deletions

View File

@ -0,0 +1,33 @@
From 0a49c04428ff99fdf29edf32e043e04fae492b6d Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Mon, 14 Jul 2014 11:24:44 -0400
Subject: [PATCH 1/5] Remove unused DEPRECATED macro
---
open-vm-tools/lib/include/vm_assert.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/open-vm-tools/lib/include/vm_assert.h b/open-vm-tools/lib/include/vm_assert.h
index 5b02eed..48c9f1d 100644
--- a/open-vm-tools/lib/include/vm_assert.h
+++ b/open-vm-tools/lib/include/vm_assert.h
@@ -282,16 +282,6 @@ void WarningThrottled(uint32 *count, const char *fmt, ...)
#define LOG_ONCE(_s) DO_ONCE(Log _s)
-#ifdef VMX86_DEVEL
- #define DEPRECATED(_fix) DO_ONCE( \
- Warning("%s:%d: %s is DEPRECATED; %s\n", \
- __FILE__, __LINE__, __FUNCTION__, \
- _fix))
-#else
- #define DEPRECATED(_fix) do {} while (0)
-#endif
-
-
/*
* Redefine macros that are only in debug versions
*/
--
2.0.1

View File

@ -0,0 +1,34 @@
From 9a38a9da20c898c4c21e84e1cf4f97c5b63f6a87 Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Mon, 14 Jul 2014 11:25:10 -0400
Subject: [PATCH 2/5] Conditionally define g_info macro
* Some versions of GLib define this macro.
---
open-vm-tools/lib/include/vmware/tools/log.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/open-vm-tools/lib/include/vmware/tools/log.h b/open-vm-tools/lib/include/vmware/tools/log.h
index 526b7c2..fa7deb4 100644
--- a/open-vm-tools/lib/include/vmware/tools/log.h
+++ b/open-vm-tools/lib/include/vmware/tools/log.h
@@ -121,6 +121,7 @@
# define FUNC __FUNCTION__
#endif
+#ifndef g_info
/*
*******************************************************************************
* g_info -- */ /**
@@ -135,7 +136,7 @@
*/
#define g_info(fmt, ...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
-
+#endif
/*
*******************************************************************************
--
2.0.1

View File

@ -0,0 +1,311 @@
From 327938705e9223cdc15c5e0d85b0cdfafb4b6cd7 Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Sun, 13 Jul 2014 18:19:35 -0400
Subject: [PATCH 3/5] Add kuid_t/kgid_t compatibility layer
---
open-vm-tools/modules/linux/vmhgfs/filesystem.c | 20 ++--
open-vm-tools/modules/linux/vmhgfs/fsutil.c | 118 ++++++++++++++++++++----
open-vm-tools/modules/linux/vmhgfs/fsutil.h | 5 +-
open-vm-tools/modules/linux/vmhgfs/inode.c | 18 +++-
open-vm-tools/modules/linux/vmhgfs/module.h | 14 ++-
5 files changed, 145 insertions(+), 30 deletions(-)
diff --git a/open-vm-tools/modules/linux/vmhgfs/filesystem.c b/open-vm-tools/modules/linux/vmhgfs/filesystem.c
index f101ca7..c845b36 100644
--- a/open-vm-tools/modules/linux/vmhgfs/filesystem.c
+++ b/open-vm-tools/modules/linux/vmhgfs/filesystem.c
@@ -228,17 +228,25 @@ HgfsInitSuperInfo(HgfsMountInfo *mountInfo) // IN: Passed down from the user
* or gid given to us by the server.
*/
si->uidSet = mountInfo->uidSet;
+ si->uid = current_uid();
if (si->uidSet) {
- si->uid = mountInfo->uid;
- } else {
- si->uid = current_uid();
+ kuid_t mntUid = make_kuid(current_user_ns(), mountInfo->uid);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+ if (uid_valid(mntUid))
+#endif
+ si->uid = mntUid;
}
+
si->gidSet = mountInfo->gidSet;
+ si->gid = current_gid();
if (si->gidSet) {
- si->gid = mountInfo->gid;
- } else {
- si->gid = current_gid();
+ kgid_t mntGid = make_kgid(current_user_ns(), mountInfo->gid);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+ if (gid_valid(mntGid))
+#endif
+ si->gid = mntGid;
}
+
si->fmask = mountInfo->fmask;
si->dmask = mountInfo->dmask;
si->ttl = mountInfo->ttl * HZ; // in ticks
diff --git a/open-vm-tools/modules/linux/vmhgfs/fsutil.c b/open-vm-tools/modules/linux/vmhgfs/fsutil.c
index 28858bc..1028cc9 100644
--- a/open-vm-tools/modules/linux/vmhgfs/fsutil.c
+++ b/open-vm-tools/modules/linux/vmhgfs/fsutil.c
@@ -545,6 +545,105 @@ HgfsUnpackCommonAttr(HgfsReq *req, // IN: Reply packet
/*
*----------------------------------------------------------------------
*
+ * HgfsCalcBlockSize --
+ *
+ * Calculate the number of 512 byte blocks used.
+ *
+ * Round the size to the next whole block and divide by the block size
+ * to get the number of 512 byte blocks.
+ * Note, this is taken from the nfs client and is simply performing:
+ * (size + 512-1)/ 512)
+ *
+ * Results:
+ * The number of 512 byte blocks for the size.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)
+static inline blkcnt_t
+HgfsCalcBlockSize(uint64 tsize)
+{
+ blkcnt_t used = (tsize + 511) >> 9;
+ return (used > ULONG_MAX) ? ULONG_MAX : used;
+}
+#else
+static inline unsigned long
+HgfsCalcBlockSize(uint64 tsize)
+{
+ loff_t used = (tsize + 511) >> 9;
+ return (used > ULONG_MAX) ? ULONG_MAX : used;
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HgfsSetInodeUidGid --
+ *
+ * Set the UID and GID of the inode.
+ *
+ * Update an inode's UID and GID to match those of the HgfsAttr returned
+ * by the server.
+ *
+ * Results:
+ * The number of 512 byte blocks for the size.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+HgfsSetInodeUidGid(struct inode *inode, // IN/OUT: Inode
+ HgfsSuperInfo *si, // IN: New attrs
+ HgfsAttrInfo const *attr) // IN: New attrs
+{
+ /*
+ * Use the stored uid and gid if we were given them at mount-time, or if
+ * the server didn't give us a uid or gid.
+ */
+ if (si->uidSet || (attr->mask & HGFS_ATTR_VALID_USERID) == 0) {
+ inode->i_uid = si->uid;
+ } else {
+ kuid_t attrUid = make_kuid(&init_user_ns, attr->userId);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+ if (uid_valid(attrUid)) {
+ inode->i_uid = attrUid;
+ } else {
+ inode->i_uid = si->uid;
+ }
+#else
+ inode->i_uid = attrUid;
+#endif
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: inode uid %u\n",
+ __func__, from_kuid(&init_user_ns, inode->i_uid)));
+ }
+ if (si->gidSet || (attr->mask & HGFS_ATTR_VALID_GROUPID) == 0) {
+ inode->i_gid = si->gid;
+ } else {
+ kgid_t attrGid = make_kgid(&init_user_ns, attr->groupId);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+ if (gid_valid(attrGid)) {
+ inode->i_gid = attrGid;
+ } else {
+ inode->i_gid = si->gid;
+ }
+#else
+ inode->i_gid = attrGid;
+#endif
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: inode gid %u\n",
+ __func__, from_kgid(&init_user_ns, inode->i_gid)));
+ }
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
* HgfsChangeFileAttributes --
*
* Update an inode's attributes to match those of the HgfsAttr. May
@@ -634,20 +733,7 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode
*/
set_nlink(inode, 1);
- /*
- * Use the stored uid and gid if we were given them at mount-time, or if
- * the server didn't give us a uid or gid.
- */
- if (si->uidSet || (attr->mask & HGFS_ATTR_VALID_USERID) == 0) {
- inode->i_uid = si->uid;
- } else {
- inode->i_uid = attr->userId;
- }
- if (si->gidSet || (attr->mask & HGFS_ATTR_VALID_GROUPID) == 0) {
- inode->i_gid = si->gid;
- } else {
- inode->i_gid = attr->groupId;
- }
+ HgfsSetInodeUidGid(inode, si, attr);
inode->i_rdev = 0; /* Device nodes are not supported */
#if !defined VMW_INODE_2618
@@ -1618,8 +1704,8 @@ HgfsStatusConvertToLinux(HgfsStatus hgfsStatus) // IN: Status code to convert
void
HgfsSetUidGid(struct inode *parent, // IN: parent inode
struct dentry *dentry, // IN: dentry of file to update
- uid_t uid, // IN: uid to set
- gid_t gid) // IN: gid to set
+ kuid_t uid, // IN: uid to set
+ kgid_t gid) // IN: gid to set
{
struct iattr setUidGid;
diff --git a/open-vm-tools/modules/linux/vmhgfs/fsutil.h b/open-vm-tools/modules/linux/vmhgfs/fsutil.h
index da5c5a1..2767099 100644
--- a/open-vm-tools/modules/linux/vmhgfs/fsutil.h
+++ b/open-vm-tools/modules/linux/vmhgfs/fsutil.h
@@ -32,6 +32,7 @@
#include <linux/signal.h>
#include "compat_fs.h"
+#include "module.h" /* For kuid_t kgid_t types. */
#include "inode.h"
#include "request.h"
#include "vm_basic_types.h"
@@ -91,8 +92,8 @@ int HgfsGetHandle(struct inode *inode,
int HgfsStatusConvertToLinux(HgfsStatus hgfsStatus);
void HgfsSetUidGid(struct inode *parent,
struct dentry *dentry,
- uid_t uid,
- gid_t gid);
+ kuid_t uid,
+ kgid_t gid);
struct inode *HgfsGetInode(struct super_block *sb, ino_t ino);
void HgfsDoReadInode(struct inode *inode);
diff --git a/open-vm-tools/modules/linux/vmhgfs/inode.c b/open-vm-tools/modules/linux/vmhgfs/inode.c
index 859b3ff..caaa41a 100644
--- a/open-vm-tools/modules/linux/vmhgfs/inode.c
+++ b/open-vm-tools/modules/linux/vmhgfs/inode.c
@@ -404,6 +404,8 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from
size_t reqBufferSize;
size_t reqSize;
int result = 0;
+ uid_t attrUid = -1;
+ gid_t attrGid = -1;
ASSERT(iattr);
ASSERT(dentry);
@@ -412,6 +414,14 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from
valid = iattr->ia_valid;
+ if (valid & ATTR_UID) {
+ attrUid = from_kuid(&init_user_ns, iattr->ia_uid);
+ }
+
+ if (valid & ATTR_GID) {
+ attrGid = from_kgid(&init_user_ns, iattr->ia_gid);
+ }
+
switch (opUsed) {
case HGFS_OP_SETATTR_V3: {
HgfsRequest *requestHeader;
@@ -488,13 +498,13 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from
if (valid & ATTR_UID) {
attrV2->mask |= HGFS_ATTR_VALID_USERID;
- attrV2->userId = iattr->ia_uid;
+ attrV2->userId = attrUid;
*changed = TRUE;
}
if (valid & ATTR_GID) {
attrV2->mask |= HGFS_ATTR_VALID_GROUPID;
- attrV2->groupId = iattr->ia_gid;
+ attrV2->groupId = attrGid;
*changed = TRUE;
}
@@ -591,13 +601,13 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from
if (valid & ATTR_UID) {
attrV2->mask |= HGFS_ATTR_VALID_USERID;
- attrV2->userId = iattr->ia_uid;
+ attrV2->userId = attrUid;
*changed = TRUE;
}
if (valid & ATTR_GID) {
attrV2->mask |= HGFS_ATTR_VALID_GROUPID;
- attrV2->groupId = iattr->ia_gid;
+ attrV2->groupId = attrGid;
*changed = TRUE;
}
diff --git a/open-vm-tools/modules/linux/vmhgfs/module.h b/open-vm-tools/modules/linux/vmhgfs/module.h
index 3e0973b..b6bcd1e 100644
--- a/open-vm-tools/modules/linux/vmhgfs/module.h
+++ b/open-vm-tools/modules/linux/vmhgfs/module.h
@@ -74,6 +74,16 @@ extern int LOGLEVEL_THRESHOLD;
* Macros for accessing members that are private to this code in
* sb/inode/file structs.
*/
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
+typedef uid_t kuid_t;
+typedef gid_t kgid_t;
+#define from_kuid(_ns, _kuid) (_kuid)
+#define from_kgid(_ns, _kgid) (_kgid)
+#define make_kuid(_ns, _uid) (_uid)
+#define make_kgid(_ns, _gid) (_gid)
+#endif
+
#define HGFS_SET_SB_TO_COMMON(sb, common) do { (sb)->s_fs_info = (common); } while (0)
#define HGFS_SB_TO_COMMON(sb) ((HgfsSuperInfo *)(sb)->s_fs_info)
@@ -110,9 +120,9 @@ extern int LOGLEVEL_THRESHOLD;
/* Data kept in each superblock in sb->u. */
typedef struct HgfsSuperInfo {
- uid_t uid; /* UID of user who mounted this fs. */
+ kuid_t uid; /* UID of user who mounted this fs. */
+ kgid_t gid; /* GID of user who mounted this fs. */
Bool uidSet; /* Was the UID specified at mount-time? */
- gid_t gid; /* GID of user who mounted this fs. */
Bool gidSet; /* Was the GID specified at mount-time? */
mode_t fmask; /* File permission mask. */
mode_t dmask; /* Directory permission mask. */
--
2.0.1

View File

@ -0,0 +1,53 @@
From 20437d731289126ee5363a6f73e4171d39f2e3d9 Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Mon, 14 Jul 2014 11:32:35 -0400
Subject: [PATCH 4/5] Use new link helpers
* vfs_follow_link was removed in 3.12.
* vfs_readlink was removed in 3.15.
---
open-vm-tools/modules/linux/vmhgfs/link.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/open-vm-tools/modules/linux/vmhgfs/link.c b/open-vm-tools/modules/linux/vmhgfs/link.c
index 9fb95a5..06ea953 100644
--- a/open-vm-tools/modules/linux/vmhgfs/link.c
+++ b/open-vm-tools/modules/linux/vmhgfs/link.c
@@ -110,9 +110,15 @@ HgfsFollowlink(struct dentry *dentry, // IN: Dentry containing link
"on something that wasn't a symlink\n"));
error = -EINVAL;
} else {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
+ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsFollowlink: calling "
+ "nd_set_link\n"));
+ nd_set_link(nd, fileName);
+#else
LOG(6, (KERN_DEBUG "VMware hgfs: HgfsFollowlink: calling "
"vfs_follow_link\n"));
error = vfs_follow_link(nd, fileName);
+#endif
}
kfree(fileName);
}
@@ -172,9 +178,18 @@ HgfsReadlink(struct dentry *dentry, // IN: Dentry containing link
"on something that wasn't a symlink\n"));
error = -EINVAL;
} else {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsReadlink: calling "
+ "readlink_copy\n"));
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: calling "
+ "readlink_copy\n",
+ __func__));
+ error = readlink_copy(buffer, buflen, fileName);
+#else
LOG(6, (KERN_DEBUG "VMware hgfs: HgfsReadlink: calling "
"vfs_readlink\n"));
error = vfs_readlink(dentry, buffer, buflen, fileName);
+#endif
}
kfree(fileName);
}
--
2.0.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
From 4601d767d60e9a377c285994266c6fef49cae550 Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Fri, 15 Aug 2014 10:40:38 -0400
Subject: [PATCH 10/11] Fix vmxnet module on kernels >= 3.16
* Add compat check for ethtool_ops in net_device struct.
* SET_ETHTOOL_OPS is no longer defined, but can be manually.
---
open-vm-tools/modules/linux/shared/compat_netdevice.h | 4 ++++
open-vm-tools/modules/linux/vmxnet/vmxnet.c | 13 ++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/open-vm-tools/modules/linux/shared/compat_netdevice.h b/open-vm-tools/modules/linux/shared/compat_netdevice.h
index 3aec25b..a65d59b 100644
--- a/open-vm-tools/modules/linux/shared/compat_netdevice.h
+++ b/open-vm-tools/modules/linux/shared/compat_netdevice.h
@@ -337,4 +337,8 @@ typedef netdev_features_t compat_netdev_features_t;
typedef u32 compat_netdev_features_t;
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(SET_ETHTOOL_OPS)
+#define VMW_HAVE_ETHTOOL_OPS 1
+#endif
+
#endif /* __COMPAT_NETDEVICE_H__ */
diff --git a/open-vm-tools/modules/linux/vmxnet/vmxnet.c b/open-vm-tools/modules/linux/vmxnet/vmxnet.c
index 54b4590..7fb5692 100644
--- a/open-vm-tools/modules/linux/vmxnet/vmxnet.c
+++ b/open-vm-tools/modules/linux/vmxnet/vmxnet.c
@@ -283,8 +283,7 @@ vmxnet_change_mtu(struct net_device *dev, int new_mtu)
#endif
-
-#ifdef SET_ETHTOOL_OPS
+#ifdef VMW_HAVE_ETHTOOL_OPS
/*
*----------------------------------------------------------------------------
*
@@ -530,7 +529,7 @@ vmxnet_ethtool_ops = {
};
-#else /* !defined(SET_ETHTOOL_OPS) */
+#else /* !defined(VMW_HAVE_ETHTOOL_OPS) */
/*
@@ -743,7 +742,7 @@ vmxnet_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
}
return -EOPNOTSUPP;
}
-#endif /* SET_ETHTOOL_OPS */
+#endif /* !defined(VMW_HAVE_ETHTOOL_OPS) */
/*
@@ -1142,8 +1141,12 @@ vmxnet_probe_device(struct pci_dev *pdev, // IN: vmxnet PCI device
dev->watchdog_timeo = VMXNET_WATCHDOG_TIMEOUT;
#endif
-#ifdef SET_ETHTOOL_OPS
+#ifdef VMW_HAVE_ETHTOOL_OPS
+# ifdef SET_ETHTOOL_OPS
SET_ETHTOOL_OPS(dev, &vmxnet_ethtool_ops);
+# else
+ dev->ethtool_ops = &vmxnet_ethtool_ops;
+# endif
#else
dev->do_ioctl = vmxnet_ioctl;
#endif
--
2.0.4

View File

@ -0,0 +1,75 @@
From 6497dbbabb9506df8e16b60bf2cd396a8c6bb26b Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Fri, 15 Aug 2014 10:42:30 -0400
Subject: [PATCH 11/11] Fix vmhgfs module on kernels >= 3.16
* Use read_iter/write_iter file operations on kernels >= 3.16.
* Do not set aio_read/aio_write on kernels >= 3.16.
---
open-vm-tools/modules/linux/vmhgfs/file.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/open-vm-tools/modules/linux/vmhgfs/file.c b/open-vm-tools/modules/linux/vmhgfs/file.c
index 825cebe..67606fd 100644
--- a/open-vm-tools/modules/linux/vmhgfs/file.c
+++ b/open-vm-tools/modules/linux/vmhgfs/file.c
@@ -76,6 +76,7 @@ static int HgfsGetOpenFlags(uint32 flags);
static int HgfsOpen(struct inode *inode,
struct file *file);
#if defined VMW_USE_AIO
+# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
static ssize_t HgfsAioRead(struct kiocb *iocb,
const struct iovec *iov,
unsigned long numSegs,
@@ -84,6 +85,7 @@ static ssize_t HgfsAioWrite(struct kiocb *iocb,
const struct iovec *iov,
unsigned long numSegs,
loff_t offset);
+# endif
#else
static ssize_t HgfsRead(struct file *file,
char __user *buf,
@@ -150,15 +152,20 @@ struct file_operations HgfsFileFileOperations = {
.open = HgfsOpen,
.llseek = HgfsSeek,
.flush = HgfsFlush,
-#if defined VMW_USE_AIO
+#ifdef VMW_USE_AIO
.read = do_sync_read,
.write = do_sync_write,
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+ .read_iter = generic_file_read_iter,
+ .write_iter = generic_file_write_iter,
+# else
.aio_read = HgfsAioRead,
.aio_write = HgfsAioWrite,
-#else
+# endif
+#else /* !VMW_USE_AIO */
.read = HgfsRead,
.write = HgfsWrite,
-#endif
+#endif /* !VMW_USE_AIO */
.fsync = HgfsFsync,
.mmap = HgfsMmap,
.release = HgfsRelease,
@@ -748,6 +755,7 @@ out:
#if defined VMW_USE_AIO
+# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
/*
*----------------------------------------------------------------------
*
@@ -883,7 +891,7 @@ out:
return result;
}
-
+# endif /* if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) */
#else
/*
*----------------------------------------------------------------------
--
2.0.4

View File

@ -0,0 +1,110 @@
From e75a7401a72607476f7a248f5a7fe4f11d6d129d Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Fri, 15 Aug 2014 11:11:12 -0400
Subject: [PATCH 12/12] Fix segfault in vmhgfs
* Need to use sync read/write but also set the read_iter/write_iter
operations.
---
open-vm-tools/modules/linux/shared/compat_fs.h | 3 ++-
open-vm-tools/modules/linux/vmhgfs/file.c | 23 ++++++++++++-----------
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/open-vm-tools/modules/linux/shared/compat_fs.h b/open-vm-tools/modules/linux/shared/compat_fs.h
index f762f6f..eb53ee7 100644
--- a/open-vm-tools/modules/linux/shared/compat_fs.h
+++ b/open-vm-tools/modules/linux/shared/compat_fs.h
@@ -89,7 +89,8 @@
* changed over time, so for simplicity, we'll only enable it from 2.6.19 and
* on.
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && \
+ LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
# define VMW_USE_AIO
#endif
diff --git a/open-vm-tools/modules/linux/vmhgfs/file.c b/open-vm-tools/modules/linux/vmhgfs/file.c
index 67606fd..fcf0681 100644
--- a/open-vm-tools/modules/linux/vmhgfs/file.c
+++ b/open-vm-tools/modules/linux/vmhgfs/file.c
@@ -76,7 +76,6 @@ static int HgfsGetOpenFlags(uint32 flags);
static int HgfsOpen(struct inode *inode,
struct file *file);
#if defined VMW_USE_AIO
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
static ssize_t HgfsAioRead(struct kiocb *iocb,
const struct iovec *iov,
unsigned long numSegs,
@@ -85,7 +84,6 @@ static ssize_t HgfsAioWrite(struct kiocb *iocb,
const struct iovec *iov,
unsigned long numSegs,
loff_t offset);
-# endif
#else
static ssize_t HgfsRead(struct file *file,
char __user *buf,
@@ -155,14 +153,13 @@ struct file_operations HgfsFileFileOperations = {
#ifdef VMW_USE_AIO
.read = do_sync_read,
.write = do_sync_write,
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
- .read_iter = generic_file_read_iter,
- .write_iter = generic_file_write_iter,
-# else
.aio_read = HgfsAioRead,
.aio_write = HgfsAioWrite,
-# endif
#else /* !VMW_USE_AIO */
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+ .read_iter = generic_file_read_iter,
+ .write_iter = generic_file_write_iter,
+# endif
.read = HgfsRead,
.write = HgfsWrite,
#endif /* !VMW_USE_AIO */
@@ -755,7 +752,6 @@ out:
#if defined VMW_USE_AIO
-# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
/*
*----------------------------------------------------------------------
*
@@ -890,8 +886,6 @@ out:
spin_unlock(&writeDentry->d_inode->i_lock);
return result;
}
-
-# endif /* if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) */
#else
/*
*----------------------------------------------------------------------
@@ -933,8 +927,11 @@ HgfsRead(struct file *file, // IN: File to read from
LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRead: invalid dentry\n"));
goto out;
}
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+ result = new_sync_read(file, buf, count, offset);
+#else
result = generic_file_read(file, buf, count, offset);
+#endif
out:
return result;
}
@@ -985,7 +982,11 @@ HgfsWrite(struct file *file, // IN: File to write to
goto out;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+ result = new_sync_write(file, buf, count, offset);
+#else
result = generic_file_write(file, buf, count, offset);
+#endif
out:
return result;
}
--
2.0.4

View File

@ -1,14 +0,0 @@
diff -uNr open-vm-tools-9.4.0-1280544.orig/lib/include/vmware/tools/log.h open-vm-tools-9.4.0-1280544/lib/include/vmware/tools/log.h
--- open-vm-tools-9.4.0-1280544.orig/lib/include/vmware/tools/log.h 2013-09-23 19:51:10.000000000 +0400
+++ open-vm-tools-9.4.0-1280544/lib/include/vmware/tools/log.h 2014-02-18 10:56:50.368604176 +0400
@@ -134,7 +134,9 @@
*******************************************************************************
*/
-#define g_info(fmt, ...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
+#if !defined(g_info)
+# define g_info(fmt, ...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
+#endif
/*

View File

@ -1,12 +1,28 @@
-------------------------------------------------------------------
Mon Nov 10 16:01:56 UTC 2014 - dimstar@opensuse.org
- Sync up patches with ArchLinux:
+ Added 0001-Remove-unused-DEPRECATED-macro.patch
+ Added 0002-Conditionally-define-g_info-macro.patch
+ Added 0003-Add-kuid_t-kgid_t-compatibility-layer.patch
+ Added 0004-Use-new-link-helpers.patch
+ Added 0005-Update-hgfs-file-operations-for-newer-kernels.patch
+ Added 0006-Fix-vmxnet-module-on-kernels-3.16.patch
+ Added 0007-Fix-vmhgfs-module-on-kernels-3.16.patch
+ Added 0008-Fix-segfault-in-vmhgfs.patch
+ Droped g_info_redefine.patch (now named
0002-Conditionally-define-g_info-macro.patch).
- Enable building of KMP packages.
-------------------------------------------------------------------
Mon Nov 10 01:03:00 UTC 2014 - Led <ledest@gmail.com>
- fix bashisms in preun script
- Fix bashisms in preun script.
-------------------------------------------------------------------
Fri Oct 31 00:34:20 UTC 2014 - crrodriguez@opensuse.org
- Do not generate timestamps in the doxygen docs.
- Do not generate timestamps in the doxygen docs.
-------------------------------------------------------------------
Fri Oct 24 12:32:38 UTC 2014 - dimstar@opensuse.org

View File

@ -19,10 +19,8 @@
%define with_systemd 1
# vmhgfs modules does not build on kernel 3.11
%if 0%{suse_version} < 1310
# The vmhgfs modules is used with all versions
%define vmhgfs vmhgfs
%endif
# disable systemd if before 13.1
%if 0%{suse_version} < 1310
@ -69,8 +67,14 @@ Source5: vmware-user-autostart-wrapper
Source6: open-vm-tools-modprobe.conf
Source7: tools.conf
Source98: preamble
# PATCH-FIX-UPSTREAM g_info_redefine.patch (RHBZ#1063847)
Patch0: g_info_redefine.patch
Patch1: 0001-Remove-unused-DEPRECATED-macro.patch
Patch2: 0002-Conditionally-define-g_info-macro.patch
Patch3: 0003-Add-kuid_t-kgid_t-compatibility-layer.patch
Patch4: 0004-Use-new-link-helpers.patch
Patch5: 0005-Update-hgfs-file-operations-for-newer-kernels.patch
Patch6: 0006-Fix-vmxnet-module-on-kernels-3.16.patch
Patch7: 0007-Fix-vmhgfs-module-on-kernels-3.16.patch
Patch8: 0008-Fix-segfault-in-vmhgfs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc-c++
# don't use pkgconfig(gtk+-2.0) so we can build on SLE
@ -115,10 +119,7 @@ Requires(pre): %insserv_prereq
Requires(pre): permissions
ExclusiveArch: %ix86 x86_64
# Only build KMP on versions below 13.1
%if 0%{?suse_version} < 1310
%suse_kernel_module_package -n vmware-guest -p %{SOURCE98} xen um
%endif
%if %{with_systemd}
%systemd_requires
@ -215,7 +216,14 @@ if you intend to create own plugins for vmtoolsd.
chmod -x AUTHORS COPYING ChangeLog NEWS README
# fix for an rpmlint warning regarding wrong line feeds
sed -i -e "s/\r//" README
%patch0 -p1 -b .g_info
%patch1 -p2
%patch2 -p2
%patch3 -p2
%patch4 -p2
%patch5 -p2
%patch6 -p2
%patch7 -p2
%patch8 -p2
%build
# disable warning unused-but-set-variable which will raise error because of -Werror