mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] smb: client: fix cached-dir and deferred-close unmount races
@ 2026-11-18  0:25 Siddharth Chintamaneni
  2026-11-18  0:25 ` [PATCH v1 1/2] smb: client: drop dentries for dying cached dirs during unmount Siddharth Chintamaneni
  2026-11-18  0:25 ` [PATCH v1 2/2] smb: client: fix busy dentry on unmount from cancelled deferred close Siddharth Chintamaneni
  0 siblings, 2 replies; 3+ messages in thread
From: Siddharth Chintamaneni @ 2026-11-18  0:25 UTC (permalink / raw)
  To: Paulo Alcantara
  Cc: Ronnie Sahlberg, Shyam Prasad N, Tom Talpey, Bharath SM,
	Allen Pais, Rachel Menge, Hardik Garg, Siddharth Chintamaneni,
	Gillian Laming, linux-cifs, linux-kernel

While investigating the cifs_kill_sb() unmount busy-dentry race fixed in
"smb: client: fix busy dentry and inode on unmount from late oplock
break" [1], I wrote a static analysis tool with AI assistance to scan
for the same teardown pattern where objects are moved off shared lists
and locks are dropped before their underlying dentry references are
released.

That scan identified two more unmount races in cifs_kill_sb(), both of
which I reproduced in QEMU where cifs_kill_sb() reaches
generic_shutdown_super() while dentries are still in use:

- Patch 1 walks cfids->dying under cfids->cfid_list_lock in
  close_all_cached_dirs() and holds cifs_sb->outstanding_rreq across
  dput(dentry) in smb2_close_cached_fid() so dentries for dying or
  concurrently closed cached directories are dropped before
  kill_anon_super() runs.
- Patch 2 counts cancelled deferred-close handles in
  cifs_sb->outstanding_rreq while they sit on a local stack list before
  _cifsFileInfo_put() completes in cifs_close_deferred_file(),
  cifs_close_all_deferred_files(), and
  cifs_close_deferred_file_under_dentry().

[1] https://lore.kernel.org/all/20261117001733.192399-1-sidchintamaneni@gmail.com/

Siddharth Chintamaneni (2):
  smb: client: drop dentries for dying cached dirs during unmount
  smb: client: fix busy dentry on unmount from cancelled deferred close

 fs/smb/client/cached_dir.c | 31 +++++++++++++++++++++++++++++--
 fs/smb/client/misc.c       | 32 +++++++++++++++++++++++++++++---
 2 files changed, 58 insertions(+), 5 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-18  0:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18  0:25 [PATCH v1 0/2] smb: client: fix cached-dir and deferred-close unmount races Siddharth Chintamaneni
2026-11-18  0:25 ` [PATCH v1 1/2] smb: client: drop dentries for dying cached dirs during unmount Siddharth Chintamaneni
2026-11-18  0:25 ` [PATCH v1 2/2] smb: client: fix busy dentry on unmount from cancelled deferred close Siddharth Chintamaneni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®