Commit c91ecba9 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French
Browse files

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: 97c2ec64 ("ksmbd: avoid to send duplicate lease break notifications")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent a38297e3
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -610,8 +610,10 @@ 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 !=
			if (opinfo->is_lease == false)
				return 1;

			if (opinfo->o_lease->state !=
			    (SMB2_LEASE_HANDLE_CACHING_LE |
			     SMB2_LEASE_READ_CACHING_LE))
				return 1;
@@ -619,8 +621,11 @@ static int oplock_break_pending(struct oplock_info *opinfo, int req_op_level)
	}

	if (opinfo->level <= req_op_level) {
		if (opinfo->is_lease &&
		    opinfo->o_lease->state !=
		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);