Skip to content

Commit c91ecba

Browse files
namjaejeonSteve French
authored andcommitted
ksmbd: avoid to send duplicate oplock break notifications
This patch fixes generic/011 when oplocks is enable. Avoid to send duplicate oplock break notifications like smb2 leases case. Fixes: 97c2ec6 ("ksmbd: avoid to send duplicate lease break notifications") Cc: stable@vger.kernel.org Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent a38297e commit c91ecba

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

fs/smb/server/oplock.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -610,19 +610,24 @@ static int oplock_break_pending(struct oplock_info *opinfo, int req_op_level)
610610
if (opinfo->op_state == OPLOCK_CLOSING)
611611
return -ENOENT;
612612
else if (opinfo->level <= req_op_level) {
613-
if (opinfo->is_lease &&
614-
opinfo->o_lease->state !=
615-
(SMB2_LEASE_HANDLE_CACHING_LE |
616-
SMB2_LEASE_READ_CACHING_LE))
613+
if (opinfo->is_lease == false)
614+
return 1;
615+
616+
if (opinfo->o_lease->state !=
617+
(SMB2_LEASE_HANDLE_CACHING_LE |
618+
SMB2_LEASE_READ_CACHING_LE))
617619
return 1;
618620
}
619621
}
620622

621623
if (opinfo->level <= req_op_level) {
622-
if (opinfo->is_lease &&
623-
opinfo->o_lease->state !=
624-
(SMB2_LEASE_HANDLE_CACHING_LE |
625-
SMB2_LEASE_READ_CACHING_LE)) {
624+
if (opinfo->is_lease == false) {
625+
wake_up_oplock_break(opinfo);
626+
return 1;
627+
}
628+
if (opinfo->o_lease->state !=
629+
(SMB2_LEASE_HANDLE_CACHING_LE |
630+
SMB2_LEASE_READ_CACHING_LE)) {
626631
wake_up_oplock_break(opinfo);
627632
return 1;
628633
}

0 commit comments

Comments
 (0)