if (attr->mask & HGFS_ATTR_VALID_WRITE_TIME) {
HGFS_DECLARE_TIME(newTime);
HGFS_SET_TIME(newTime, attr->writeTime);
+ LOG(4, (KERN_DEBUG "VMware hgfs: %s: server mod "
+ "time: %ld:%lu, inode mod time: %ld:%lu\n", __func__,
+ HGFS_PRINT_TIME(newTime), HGFS_PRINT_TIME(inode->i_mtime)));
if (hgfs_timespec_compare(&newTime, &inode->i_mtime) > 0 &&
iinfo->numWbPages == 0 &&
isSafeToChange) {
#include <linux/namei.h>
#endif
#include <linux/highmem.h>
+#include <linux/time.h> // for current_fs_time
#include "compat_cred.h"
#include "compat_dcache.h"
"%d\n", result));
}
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
+ if (result == 0) {
+ /*
+ * We force revalidate to go get the file info as soon as needed.
+ * We only add this fix, borrowed from CIFS, for newer versions
+ * of the kernel which have the current_fs_time function.
+ * For details see bug 1613734 but here is a short summary.
+ * This addresses issues in editors such as gedit which use
+ * rename when saving the updated contents of a file.
+ * If we don't force the revalidation here, then the dentry
+ * will randomly age over some time which will then pick up the
+ * file's new timestamps from the server at that time.
+ * This delay will cause the editor to think the file has been modified
+ * underneath it and prompt the user if they want to reload the file.
+ */
+ HgfsDentryAgeForce(oldDentry);
+ HgfsDentryAgeForce(newDentry);
+ oldDir->i_ctime = oldDir->i_mtime = newDir->i_ctime =
+ newDir->i_mtime = current_fs_time(oldDir->i_sb);
+ }
+#endif // LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
+
out:
HgfsFreeRequest(req);
return result;
#ifndef _VMHGFS_VERSION_H_
#define _VMHGFS_VERSION_H_
-#define VMHGFS_DRIVER_VERSION 2.0.19.0
-#define VMHGFS_DRIVER_VERSION_COMMAS 2,0,19,0
-#define VMHGFS_DRIVER_VERSION_STRING "2.0.19.0"
+#define VMHGFS_DRIVER_VERSION 2.0.20.0
+#define VMHGFS_DRIVER_VERSION_COMMAS 2,0,20,0
+#define VMHGFS_DRIVER_VERSION_STRING "2.0.20.0"
#endif /* _VMHGFS_VERSION_H_ */