]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ksmbd: share SMB2 lease state across opens
authorNamjae Jeon <linkinjeon@kernel.org>
Thu, 18 Jun 2026 01:35:06 +0000 (10:35 +0900)
committerSteve French <stfrench@microsoft.com>
Tue, 23 Jun 2026 01:15:04 +0000 (20:15 -0500)
commit079927f5fda5a05355a620d794e2f4b9eb1f70fd
tree83c653c16b0b052361d8081dfefa1089138710f7
parent0fa8abc6ab6dcc571f76c1e05ad3582540fb56d5
ksmbd: share SMB2 lease state across opens

Model SMB2 leases as per-client/per-key objects instead of keeping a
separate lease copy in every oplock_info. The lease table now stores
lease objects and each lease tracks the opens that reference it.

This makes same ClientGuid/LeaseKey opens observe a single lease state,
so lease upgrades, breaks, ACKs, and close teardown do not diverge across
per-open copies. Keep one reference for the lease table entry and one
reference for each open, and remove the table entry when the last open is
detached.

Update lease break ACK handling to refresh all open oplock levels from
the shared lease state.

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
fs/smb/server/smb2pdu.c