Skip to content

Commit

Permalink
ksmbd: avoid to send duplicate oplock break notifications
Browse files Browse the repository at this point in the history
This patch fixes generic/011 when oplocks is enable.

Avoid to send duplicate oplock break notifications like smb2 leases
case.

Fixes: 97c2ec64667b ("ksmbd: avoid to send duplicate lease break notifications")
Cc: [email protected]
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
namjaejeon committed May 15, 2024
1 parent 212f433 commit 31f81bf
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions oplock.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,19 +709,24 @@ static int oplock_break_pending(struct oplock_info *opinfo, int req_op_level)
if (opinfo->op_state == OPLOCK_CLOSING)
return -ENOENT;
else if (opinfo->level <= req_op_level) {
if (opinfo->is_lease &&
opinfo->o_lease->state !=
(SMB2_LEASE_HANDLE_CACHING_LE |
SMB2_LEASE_READ_CACHING_LE))
if (opinfo->is_lease == false)
return 1;

if (opinfo->o_lease->state !=
(SMB2_LEASE_HANDLE_CACHING_LE |
SMB2_LEASE_READ_CACHING_LE))
return 1;
}
}

if (opinfo->level <= req_op_level) {
if (opinfo->is_lease &&
opinfo->o_lease->state !=
(SMB2_LEASE_HANDLE_CACHING_LE |
SMB2_LEASE_READ_CACHING_LE)) {
if (opinfo->is_lease == false) {
wake_up_oplock_break(opinfo);
return 1;
}
if (opinfo->o_lease->state !=
(SMB2_LEASE_HANDLE_CACHING_LE |
SMB2_LEASE_READ_CACHING_LE)) {
wake_up_oplock_break(opinfo);
return 1;
}
Expand Down

0 comments on commit 31f81bf

Please sign in to comment.