summaryrefslogtreecommitdiff
path: root/source3/smbd/oplock.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-09-14 16:10:58 +0200
committerStefan Metzmacher <metze@samba.org>2018-10-02 18:13:20 +0200
commit56139b8ec621d47d542042e7aa512aa07fd53fd0 (patch)
tree855aac9e3921ca25097165e4c961daacd84a503c /source3/smbd/oplock.c
parent664808af09bf42206af2ce15c9e9b5d773ab56ca (diff)
downloadsamba-56139b8ec621d47d542042e7aa512aa07fd53fd0.tar.gz
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 <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/smbd/oplock.c')
-rw-r--r--source3/smbd/oplock.c4
1 files changed, 2 insertions, 2 deletions
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 {