summaryrefslogtreecommitdiff
path: root/rust/kernel/drm/gpuvm/git@git.tavy.me:linux-stable.git
diff options
context:
space:
mode:
authorXu Rao <raoxu@uniontech.com>2026-07-07 21:30:17 +0800
committerSteve French <stfrench@microsoft.com>2026-07-08 18:44:03 -0500
commit0b043279e73880bee21d3b1f221bafda5af1b27e (patch)
treeadc37ab4640a44d47daeb7d5f8d653d38f4e6b77 /rust/kernel/drm/gpuvm/git@git.tavy.me:linux-stable.git
parent027a84ac6b50c12ef767c15abfc58aa865820e9e (diff)
smb: client: fix atime clamp check in read completion
cifs_rreq_done() updates the inode atime to current_time(inode) after a netfs read. It then preserves the CIFS rule that atime should not be older than mtime, because some applications break if atime is less than mtime. That rule only requires clamping when atime < mtime. The current check uses the raw non-zero result of timespec64_compare(). It therefore takes the clamp path for both atime < mtime and atime > mtime. The latter is the normal case when reading an older file: the newly recorded atime is newer than the file mtime. The completion handler then immediately moves atime back to mtime, losing the access time that was just recorded. Userspace tools that rely on atime, such as stat, find -atime, backup tools or cold-data classifiers, can therefore see a recently read CIFS file as not recently accessed. This is easy to miss because the bug is silent: read I/O still succeeds, no error is reported, and many systems either do not check atime after reads or mount with policies such as relatime/noatime. It becomes visible when a CIFS file has an mtime older than the current time, the file is read, and the local inode atime is inspected before a later revalidation replaces the cached timestamps. Clamp only when atime is actually older than mtime. This matches the same atime/mtime rule used when applying CIFS inode attributes. Fixes: 69c3c023af25 ("cifs: Implement netfslib hooks") Cc: stable@vger.kernel.org Signed-off-by: Xu Rao <raoxu@uniontech.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'rust/kernel/drm/gpuvm/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions