From: Volker Lendecke Date: Fri, 14 Sep 2018 14:10:58 +0000 (+0200) Subject: smbd: Simplify downgrade_lease X-Git-Tag: tdb-1.3.17~1463 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56139b8ec621d47d542042e7aa512aa07fd53fd0;p=thirdparty%2Fsamba.git smbd: Simplify downgrade_lease To me, the "additive" SMB2_LEASE_WRITE|SMB2_LEASE_HANDLE is easier to read than the negated ~SMB2_LEASE_READ. Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index ded47b2f525..7ed223ddcfe 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -569,7 +569,7 @@ static NTSTATUS downgrade_share_lease(struct smbd_server_connection *sconn, l->current_state, l->breaking_to_required); l->breaking_to_requested = l->breaking_to_required; - if (l->current_state & (~SMB2_LEASE_READ)) { + if (l->current_state & (SMB2_LEASE_WRITE|SMB2_LEASE_HANDLE)) { /* * Here we break in steps, as windows does * see the breaking3 and v2_breaking3 tests. @@ -646,7 +646,7 @@ NTSTATUS downgrade_lease(struct smbXsrv_connection *xconn, state->new_epoch = l->epoch; } - if (l->current_state & (~SMB2_LEASE_READ)) { + if (l->current_state & (SMB2_LEASE_WRITE|SMB2_LEASE_HANDLE)) { state->break_flags = SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED; } else {