ksmbd_close_...ete_on_close(9)
β¨ NAME β¨
Hiii bestie π«Ά welcome to the ksmbd_close_...ete_on_close(9) page from the Kernel API Manual β yes, that name is a whole tongue-twister, but we're locked in π
The function is ksmbd_close_disconnected_durable_delete_on_close, and its job is literally: drop a delete-on-close file kept present only by disconnected durable handles β¨
π SYNOPSIS π
The signature, bestie, exactly:
bool ksmbd_close_disconnected_durable_delete_on_close (struct dentry
*dentry );
π¦ ARGUMENTS π¦
dentryβ dentry of the file being opened. That's the one and only argument, no cap π
π DESCRIPTION π
Okay so here's the lore π A durable handle that was opened with delete-on-close gets preserved across a disconnect, which means a durable reconnect can reclaim it. Iconic behavior, honestly β¨ But if a new open β specifically a non-reconnect one β shows up for that same name instead, the disconnected handle has to give way. Sorry bestie, the new open is the main character now π
So we close handles like that, which applies their delete-on-close and removes the file once the last handle is gone; that lets the new open create a fresh file. Fresh file, fresh start, slay π±
And the careful little choreo: before closing, the caller's inode reference gets dropped, so the final close can promote S_DEL_ON_CLS to S_DEL_PENDING and unlink the file. That's the detail that makes the whole thing work, iykyk π§
β RETURN β
Returns true if a disconnected durable handle was closed. That's the whole boolean, bestie π«Ά true-core
π SEE ALSO π
- Kernel file
./fs/smb/server/vfs_cache.c ksmbd_update_fstate(9)ksmbd_vfs_compare_durable_owner(9)
mwah π β source/version ./fs/smb/server, dated October 2026, page ksmbd_close_...ete_on_close(9). Bye bestie π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms