]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ksmbd: preserve open change time across rename
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 21 Jun 2026 10:36:40 +0000 (19:36 +0900)
committerSteve French <stfrench@microsoft.com>
Tue, 23 Jun 2026 01:15:05 +0000 (20:15 -0500)
commit24dcee8305d6ba18c69594ca6fb42eaa32f8e63e
tree00b993294e4cf9f2ec0b04c1c67625c1df80365d
parent16c30649709d949b439273e61769028b1e706327
ksmbd: preserve open change time across rename

inode ctime is updated when a file is renamed. ksmbd returned that
ctime directly as SMB2 ChangeTime for handle-based query information.
This makes ChangeTime change after a rename through an already-open
handle, while Windows keeps the handle's ChangeTime stable for this
case.

Store the SMB ChangeTime in struct ksmbd_file when the handle is opened
and use that value for create, close, and handle-based query information
responses.  If a client explicitly sets FILE_BASIC_INFORMATION
ChangeTime, update the stored value as well.

This fixes smbtorture smb2.rename.simple_modtime, which expects
ChangeTime and LastWriteTime to remain unchanged after renaming an
already-open file.

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