]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ksmbd: coalesce sub-15ms write time updates on close
authorNamjae Jeon <linkinjeon@kernel.org>
Wed, 1 Jul 2026 14:59:29 +0000 (23:59 +0900)
committerSteve French <stfrench@microsoft.com>
Mon, 6 Jul 2026 12:55:41 +0000 (07:55 -0500)
commita0b765030f6ba37aaac59618d4f39dac18d42757
treed833cd7edce58cebfee36471c1c2d16ae3d10b9a
parent4b706360ffb7e459cb3d3edae30b06a584f6eddd
ksmbd: coalesce sub-15ms write time updates on close

Windows reports automatic write-time updates with a resolution of roughly
15 milliseconds. If a file is written and closed within that interval, a
close response requesting full information can report the write time from
the open rather than the filesystem's finer-grained mtime update.

ksmbd currently converts the filesystem mtime directly in SMB2 CLOSE, so
even a sub-millisecond write is visible to the client. This makes
smb2.timestamp_resolution.resolution1 fail because the immediate write
changes LastWriteTime.

Save the write time returned by SMB2 CREATE in the file handle. When CLOSE
requests post-query attributes, coalesce a positive mtime change smaller
than 15 milliseconds to that saved value. Larger changes remain visible,
including the test's write after a 20 millisecond delay.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/smb2pdu.c
fs/smb/server/vfs_cache.h