open-vm-tools/0004-vmhgfs-bdi-kernel-4.0.patch
Dominique Leuenberger 70390920d1 Accepting request 309111 from home:mlatimer:branches:Virtualization:VMware
Updating to version 9.10.0.

Highlights include:
  - Update to open-vm-tools-9.10.0-2476743:
  - Build using gcc4.7 for SLES11 environments to avoid mul64.h dependency problem for i586 architectures (Note - This prevents building on <= SLES11SP2)
  - Add libmspack BuildRequires (required by deploypkg).
  - Add openssl BuildRequires (required by grabbitmqproxy and vgauth).
  - Compile using --without-xmlsecurity and --without-xerces as pkgconfig(xml-security-c) is not yet available in the build service, (this disables vgauth support).
  - Disable deploypkg for older versions of SLES and openSUSE.
  - Disable ssl for older versions of SLES and openSUSE (this disables grabbitmqproxy and vgauth).
  - Update spec file to be compatible with SLES and openSUSE.

OBS-URL: https://build.opensuse.org/request/show/309111
OBS-URL: https://build.opensuse.org/package/show/Virtualization:VMware/open-vm-tools?expand=0&rev=294
2015-05-29 10:00:01 +00:00

78 lines
2.5 KiB
Diff

This patch fixes a nasty bug with vmhgfs on kernel 4.x: files modified
on shared folders becomes 0 bytes on host.
(Patch found at https://github.com/rasa/vmware-tools-patches)
Index: open-vm-tools-9.10.0-2476743/modules/linux/vmhgfs/filesystem.c
===================================================================
--- open-vm-tools-9.10.0-2476743.orig/modules/linux/vmhgfs/filesystem.c
+++ open-vm-tools-9.10.0-2476743/modules/linux/vmhgfs/filesystem.c
@@ -386,8 +386,20 @@ HgfsReadSuper(struct super_block *sb, //
return PTR_ERR(si);
}
HGFS_SET_SB_TO_COMMON(sb, si);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
+ result = bdi_setup_and_register(&si->bdi, "vmhgfs");
+ if (result) {
+ kfree(si->shareName);
+ kfree(si);
+ }
+#endif
+
sb->s_magic = HGFS_SUPER_MAGIC;
sb->s_op = &HgfsSuperOperations;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
+ sb->s_bdi = &si->bdi;
+#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
sb->s_d_op = &HgfsDentryOperations;
@@ -427,6 +439,9 @@ HgfsReadSuper(struct super_block *sb, //
exit:
if (result) {
dput(rootDentry);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
+ bdi_destroy(&si->bdi);
+#endif
kfree(si->shareName);
kfree(si);
}
Index: open-vm-tools-9.10.0-2476743/modules/linux/vmhgfs/module.h
===================================================================
--- open-vm-tools-9.10.0-2476743.orig/modules/linux/vmhgfs/module.h
+++ open-vm-tools-9.10.0-2476743/modules/linux/vmhgfs/module.h
@@ -29,6 +29,7 @@
#include "driver-config.h"
#include <asm/atomic.h>
+#include <linux/backing-dev.h>
#include "compat_fs.h"
#include "compat_semaphore.h"
#include "compat_slab.h"
@@ -130,6 +131,9 @@ typedef struct HgfsSuperInfo {
uint32 ttl; /* Maximum dentry age (in ticks). */
char *shareName; /* Mounted share name. */
size_t shareNameLen; /* To avoid repeated strlen() calls. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
+ struct backing_dev_info bdi;
+#endif
} HgfsSuperInfo;
/*
Index: open-vm-tools-9.10.0-2476743/modules/linux/vmhgfs/super.c
===================================================================
--- open-vm-tools-9.10.0-2476743.orig/modules/linux/vmhgfs/super.c
+++ open-vm-tools-9.10.0-2476743/modules/linux/vmhgfs/super.c
@@ -152,6 +152,9 @@ HgfsPutSuper(struct super_block *sb) //
si = HGFS_SB_TO_COMMON(sb);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
+ bdi_destroy(&si->bdi);
+#endif
kfree(si->shareName);
kfree(si);
}