From: Ralph Boehme Date: Mon, 27 Oct 2025 15:15:30 +0000 (+0100) Subject: scavenger: ignore failures to remove lease X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e9bc94e3c1c19ad149b174ee0af018b6bce2bade;p=thirdparty%2Fsamba.git scavenger: ignore failures to remove lease Allows to add more cleanup code after the lease cleanup. Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/scavenger.c b/source3/smbd/scavenger.c index 5600ac88060..8c5835bdf30 100644 --- a/source3/smbd/scavenger.c +++ b/source3/smbd/scavenger.c @@ -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; } }