]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ksmbd: honor SMB2 v2 lease epochs
authorNamjae Jeon <linkinjeon@kernel.org>
Thu, 18 Jun 2026 12:32:29 +0000 (21:32 +0900)
committerSteve French <stfrench@microsoft.com>
Tue, 23 Jun 2026 01:15:04 +0000 (20:15 -0500)
commitdc2264a9efe7b56040b018024d1dfe0b3839d5ae
treef61c0daeb4e11623d2bb7545bcbb86fe71e18d36
parent752bbd323e779691998920035b6e9417d5a6a78c
ksmbd: honor SMB2 v2 lease epochs

v2 lease responses should continue from the client supplied epoch.
Initialize a new v2 lease from the requested epoch plus one so create
responses match the epoch returned by Windows and expected by smbtorture.

For a single chained break sequence, increment the epoch only for the first
break notification. Follow-up breaks such as RH->R and R->NONE in
smb2.lease.v2_breaking3 reuse the same epoch.

Record when a waiter slept behind pending_break and let the later
truncate/open overwrite break consume that marker to reuse the current
epoch instead of assigning a new one.

Do not increment the epoch when a same-client, same-key create asks for
the already granted RH state. The epoch changes only when the granted lease
state changes.

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