[PATCH] force revalidate to accomodate coarser granularity timestamps

Shirish Pargaonkar shirishpargaonkar at gmail.com
Wed Jan 13 14:06:34 MST 2010


Signed-off-by: Shirish Pargaonkar <shirishpargaonkar at gmail.com>
---
 fs/cifs/inode.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index cf18ee7..7db26a5 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1762,8 +1762,18 @@ cifs_setattr_unix(struct dentry *direntry,
struct iattr *attrs)
 					CIFS_MOUNT_MAP_SPECIAL_CHR);
 	}

-	if (!rc)
-		rc = inode_setattr(inode, attrs);
+	if (rc)
+		goto out;
+
+	rc = inode_setattr(inode, attrs);
+
+	/*
+	 * force revalidate when any of the times are set since some
+	 * of the fs types do not have finer granularity timestamps
+	 */
+	if ((!rc) && (attrs->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_CTIME)))
+		cifsInode->time = 0;
+
 out:
 	kfree(args);
 	kfree(full_path);
-- 
1.6.0.2


More information about the linux-cifs-client mailing list