From: Volker Lendecke Date: Wed, 10 Apr 2019 13:14:38 +0000 (+0200) Subject: smbd: Introduce a helper variable in delay_for_oplock() X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=3eed19de04887bec8a01af55eb33acc89ef80b7c;p=herb%2Fsamba-autobuild%2F.git smbd: Introduce a helper variable in delay_for_oplock() This removes a few explicit share_mode_lease dereferences Signed-off-by: Volker Lendecke Reviewed-by: Christof Schmitt --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index c7056a30236..38aaa7d267b 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1867,9 +1867,11 @@ static bool delay_for_oplock(files_struct *fsp, uint32_t e_lease_type = get_lease_type(d, e); uint32_t break_to; uint32_t delay_mask = 0; + bool lease_is_breaking = false; if (e_is_lease) { l = &d->leases[e->lease_idx]; + lease_is_breaking = l->breaking; } if (have_sharing_violation) { @@ -1906,7 +1908,7 @@ static bool delay_for_oplock(files_struct *fsp, } if ((e_lease_type & ~break_to) == 0) { - if (e_is_lease && l->breaking) { + if (lease_is_breaking) { delay = true; } continue; @@ -1939,7 +1941,7 @@ static bool delay_for_oplock(files_struct *fsp, if (e_lease_type & delay_mask) { delay = true; } - if (e_is_lease && l->breaking && !first_open_attempt) { + if (lease_is_breaking && !first_open_attempt) { delay = true; } continue;