]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Flush out stale file data before changing modification time
authorVMware, Inc <>
Fri, 18 Sep 2009 21:24:58 +0000 (14:24 -0700)
committerMarcelo Vanzin <mvanzin@mvanzin-dev1.eng.vmware.com>
Fri, 18 Sep 2009 22:18:43 +0000 (15:18 -0700)
This is to address bug 360310, where "cp -p" didn't preserve time and
date. See bug 360310 for details.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/vmhgfs/inode.c

index f413527958d8b044c94baf543ec3796c0940f0cc..377f1bacb72eb2841789ef4f2327ef1c772e687f 100644 (file)
@@ -1967,9 +1967,9 @@ HgfsSetattr(struct dentry *dentry,  // IN: File to set attributes of
 
    /*
     * Flush all dirty pages prior to sending the request if we're going to
-    * modify the file size.
+    * modify the file size or change the last write time.
     */
-   if (iattr->ia_valid & ATTR_SIZE) {
+   if (iattr->ia_valid & ATTR_SIZE || iattr->ia_valid & ATTR_MTIME) {
       compat_filemap_write_and_wait(dentry->d_inode->i_mapping);
    }