From: Ralph Boehme Date: Mon, 1 Dec 2025 16:48:24 +0000 (+0100) Subject: scavenger: clean up stale delete-on-close tokens in the scavenger X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ed295d763378900fcd175d07f74bfc0f2e275d1;p=thirdparty%2Fsamba.git scavenger: clean up stale delete-on-close tokens in the scavenger Currently we discard Durable Handles when processing a client disconnect that have delete-on-close set, which will then also clean up the delete-on-close token. This is going to change for Persistent Handles, so we have to prepare for cleaning up delete-on-close tokens in the scavenger. Windows takes it one step further and the file gets actually deleted: on Windows delete-on-close in set at the FSA layer so when the scavenger closes the handle, the filesystem will just follow standard delete-on-close processing and delete the file. For Samba this is hard to implement in the scavenger, as it would need to be extended to be able talk to the Samba VFS to delete the file, so we merely remove the stale delete-token and without deleting the file. Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/scavenger.c b/source3/smbd/scavenger.c index 8c5835bdf30..49698f35e8f 100644 --- a/source3/smbd/scavenger.c +++ b/source3/smbd/scavenger.c @@ -496,6 +496,10 @@ static bool cleanup_disconnected_share_mode_entry_fn( return false; } + reset_delete_on_close_lck_open_id(state->lck, + state->name_hash, + state->open_persistent_id); + /* * Setting e->stale = true is * the indication to delete the entry.