From: Ralph Boehme Date: Sun, 3 Aug 2025 10:54:59 +0000 (+0200) Subject: s3/locking: deal with Persistent Handles in share_mode_forall_entries() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=674108324915a898eb2906c692039b4317309447;p=thirdparty%2Fsamba.git s3/locking: deal with Persistent Handles in share_mode_forall_entries() Handle deleting a Persistent Handle. Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 9d8fee81ef1..90fc4baaa7c 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -2221,6 +2221,7 @@ done: } static bool share_mode_for_one_entry( + struct share_mode_data *d, bool (*fn)(struct share_mode_entry *e, bool *modified, void *private_data), @@ -2278,6 +2279,10 @@ static bool share_mode_for_one_entry( SHARE_MODE_ENTRY_SIZE); } *num_share_modes -= 1; + if (e.flags & SHARE_ENTRY_FLAG_PERSISTENT_OPEN) { + SMB_ASSERT(d->num_persistent > 0); + d->num_persistent--; + } *writeback = true; return stop; } @@ -2363,6 +2368,7 @@ bool share_mode_forall_entries( i = 0; while (i