Skip to content

Commit 69738cf

Browse files
deepa-hubsmfrench
authored andcommitted
fs: cifs: Fix atime update check vs mtime
According to the comment in the code and commit log, some apps expect atime >= mtime; but the introduced code results in atime==mtime. Fix the comparison to guard against atime<mtime. Fixes: 9b9c5be ("cifs: do not return atime less than mtime") Signed-off-by: Deepa Dinamani <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 6f582b2 commit 69738cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)
163163

164164
spin_lock(&inode->i_lock);
165165
/* we do not want atime to be less than mtime, it broke some apps */
166-
if (timespec64_compare(&fattr->cf_atime, &fattr->cf_mtime))
166+
if (timespec64_compare(&fattr->cf_atime, &fattr->cf_mtime) < 0)
167167
inode->i_atime = fattr->cf_mtime;
168168
else
169169
inode->i_atime = fattr->cf_atime;

0 commit comments

Comments
 (0)