]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: notify scavenger of disconnected persistent handles in delay_for_oplock_fn()
authorRalph Boehme <slow@samba.org>
Sat, 30 Aug 2025 13:23:39 +0000 (15:23 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:37 +0000 (10:18 +0000)
Adds an additional mechanism to trigger cleanup of possibly stale Persistent
Handle state.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/open.c

index eaf9aaaa3873cb857891842258204b727c6f96fb..904d3018af97cf758fd625fe9e35105fb2f3bc13 100644 (file)
@@ -44,6 +44,7 @@
 #include "lib/util/time_basic.h"
 #include "lib/util/smb_strtox.h"
 #include "source3/smbd/dir.h"
+#include "scavenger.h"
 
 #if defined(HAVE_LINUX_MAGIC_H)
 #include <linux/magic.h>
@@ -2427,6 +2428,12 @@ static bool delay_for_oplock_fn(
        if (e->protect) {
                uint32_t file_available_mask = SMB2_LEASE_HANDLE;
 
+               scavenger_schedule_disconnected(
+                       fsp->conn->sconn->msg_ctx,
+                       e->share_file_id,
+                       &fsp->file_id,
+                       fsp->name_hash);
+
                if (file_has_brlocks(fsp)) {
                        /*
                         * If a file has byterange locks, require an exclusive