]> git.ipfire.org Git - thirdparty/linux.git/commit
ksmbd: avoid level II oplock break notification on unlink
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 21 Jun 2026 10:49:05 +0000 (19:49 +0900)
committerSteve French <stfrench@microsoft.com>
Tue, 23 Jun 2026 01:15:05 +0000 (20:15 -0500)
commitec476c2580050ea050c562eeeb508519fc69ea21
treeeb92bac1c6458b7e874e9c5fb80c1c34ff6b3a6b
parent7db0da9915fdfd40156d01f20faac08f040fcfa3
ksmbd: avoid level II oplock break notification on unlink

smb2_util_unlink() opens the target with FILE_DELETE_ON_CLOSE and then
closes that handle.  Other clients can also mark a file for delete with
SMB2 SET_INFO FileDispositionInformation.

When these unlink paths break existing SMB2 level II oplocks, ksmbd sends
an unsolicited SMB2_OPLOCK_BREAK notification to none.  This races with the
synchronous CREATE or SET_INFO response expected by the client, and
smbtorture reports NT_STATUS_INVALID_NETWORK_RESPONSE while running
smb2.oplock.exclusive2.

SMB2 level II oplock breaks do not require an acknowledgment in the delete
path.  Keep lease handling unchanged, but drop plain SMB2 level II oplocks
locally for unlink requests without sending a break notification.  Normal
write/truncate paths still send the level II to none notification,
preserving the behavior covered by smb2.oplock.levelII500.

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