Skip to content

Commit 01fe654

Browse files
Zizhi Wosmfrench
authored andcommitted
fs: cifs: Fix atime update check
Commit 9b9c5be ("cifs: do not return atime less than mtime") indicates that in cifs, if atime is less than mtime, some apps will break. Therefore, it introduce a function to compare this two variables in two places where atime is updated. If atime is less than mtime, update it to mtime. However, the patch was handled incorrectly, resulting in atime and mtime being exactly equal. A previous commit 69738cf ("fs: cifs: Fix atime update check vs mtime") fixed one place and forgot to fix another. Fix it. Fixes: 9b9c5be ("cifs: do not return atime less than mtime") Cc: [email protected] Signed-off-by: Zizhi Wo <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 567320c commit 01fe654

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4671,7 +4671,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
46714671
/* we do not want atime to be less than mtime, it broke some apps */
46724672
atime = inode_set_atime_to_ts(inode, current_time(inode));
46734673
mtime = inode_get_mtime(inode);
4674-
if (timespec64_compare(&atime, &mtime))
4674+
if (timespec64_compare(&atime, &mtime) < 0)
46754675
inode_set_atime_to_ts(inode, inode_get_mtime(inode));
46764676

46774677
if (PAGE_SIZE > rc)

0 commit comments

Comments
 (0)