提交 69738cfd 编写于 作者: D Deepa Dinamani 提交者: Steve French

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: 9b9c5bea ("cifs: do not return atime less than mtime")
Signed-off-by: NDeepa Dinamani <deepa.kernel@gmail.com>
Cc: stfrench@microsoft.com
Cc: linux-cifs@vger.kernel.org
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 6f582b27
...@@ -163,7 +163,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) ...@@ -163,7 +163,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
/* we do not want atime to be less than mtime, it broke some apps */ /* we do not want atime to be less than mtime, it broke some apps */
if (timespec64_compare(&fattr->cf_atime, &fattr->cf_mtime)) if (timespec64_compare(&fattr->cf_atime, &fattr->cf_mtime) < 0)
inode->i_atime = fattr->cf_mtime; inode->i_atime = fattr->cf_mtime;
else else
inode->i_atime = fattr->cf_atime; inode->i_atime = fattr->cf_atime;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册