Skip to content

Commit

Permalink
[CIFS] Don't cache timestamps on utimes due to coarse granularity
Browse files Browse the repository at this point in the history
force revalidate of the file when any of the timestamps are set since
some filesytem types do not have finer granularity timestamps and
we can not always detect which file systems round timestamps down
to determine whether we can cache the mtime on setattr
samba bugzilla 3775

Acked-by: Shirish Pargaonkar <sharishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Steve French committed Feb 8, 2010
1 parent 301a6a3 commit ccd4bb1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion fs/cifs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,8 +1762,18 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
CIFS_MOUNT_MAP_SPECIAL_CHR);
}

if (!rc)
if (!rc) {
rc = inode_setattr(inode, attrs);

/* force revalidate when any of these times are set since some
of the fs types (eg ext3, fat) do not have fine enough
time granularity to match protocol, and we do not have a
a way (yet) to query the server fs's time granularity (and
whether it rounds times down).
*/
if (!rc && (attrs->ia_valid & (ATTR_MTIME | ATTR_CTIME)))
cifsInode->time = 0;
}
out:
kfree(args);
kfree(full_path);
Expand Down

0 comments on commit ccd4bb1

Please sign in to comment.