]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
scavenger: ignore failures to remove lease
authorRalph Boehme <slow@samba.org>
Mon, 27 Oct 2025 15:15:30 +0000 (16:15 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:37 +0000 (10:18 +0000)
Allows to add more cleanup code after the lease cleanup.

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

index 5600ac8806028995359e1ba28d14240534105b85..8c5835bdf307149e451970c0e7fd7512b90a94b0 100644 (file)
@@ -570,8 +570,17 @@ static bool share_mode_cleanup_disconnected(
                                               &state.e.lease_key);
                if (!NT_STATUS_IS_OK(status)) {
                        struct GUID_txt_buf gbuf;
+                       int dbg_level = DBGLVL_WARNING;
 
-                       DBG_WARNING("Failed to clean up lease associated "
+                       if ((state.e.flags & SHARE_ENTRY_FLAG_PERSISTENT_OPEN) &&
+                           NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND))
+                       {
+                               dbg_level = DBGLVL_DEBUG;
+                               ret = true;
+                       }
+
+                       DBG_PREFIX(dbg_level,
+                                  ("Failed to clean up lease associated "
                                    "with file (file-id='%s', servicepath='%s', "
                                    "name='%s', open_persistent_id=%" PRIu64
                                    "client_guid=%s, "
@@ -583,7 +592,7 @@ static bool share_mode_cleanup_disconnected(
                                    GUID_buf_string(&state.e.client_guid, &gbuf),
                                    state.e.lease_key.data[0],
                                    state.e.lease_key.data[1],
-                                   nt_errstr(status));
+                                   nt_errstr(status)));
                        goto done;
                }
        }