From: Stefan Metzmacher Date: Fri, 28 Aug 2020 13:56:35 +0000 (+0200) Subject: s3:share_mode_lock: let share_mode_forall_entries/share_entry_forall evaluate e.stale... X-Git-Tag: talloc-2.3.2~679 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deb2f782c95a5e59a0a5da4272239c2d31bc2b6d;p=thirdparty%2Fsamba.git s3:share_mode_lock: let share_mode_forall_entries/share_entry_forall evaluate e.stale first It's not really clear why e.stale would be ignored if *modified is set to true. This matches the behavior of share_mode_entry_do() This also makes sure we see the removed entry in level 10 logs again. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14428 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index ca8b2f47529..0c5626f4bd1 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -2022,6 +2022,18 @@ static bool share_mode_for_one_entry( (int)modified, (int)e.stale); + if (e.stale) { + if (*i < *num_share_modes) { + memmove(blob.data, + blob.data + SHARE_MODE_ENTRY_SIZE, + (*num_share_modes - *i - 1) * + SHARE_MODE_ENTRY_SIZE); + } + *num_share_modes -= 1; + *writeback = true; + return stop; + } + if (modified) { if (DEBUGLEVEL>=10) { DBG_DEBUG("share_mode_entry:\n"); @@ -2052,18 +2064,6 @@ static bool share_mode_for_one_entry( return stop; } - if (e.stale) { - if (*i < *num_share_modes) { - memmove(blob.data, - blob.data + SHARE_MODE_ENTRY_SIZE, - (*num_share_modes - *i - 1) * - SHARE_MODE_ENTRY_SIZE); - } - *num_share_modes -= 1; - *writeback = true; - return stop; - } - if (stop) { return true; }