From: Siddharth Chintamaneni <sidchintamaneni@gmail.com>
To: Paulo Alcantara <pc@manguebit.org>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>,
Shyam Prasad N <sprasad@microsoft.com>,
Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>,
Allen Pais <apais@microsoft.com>,
Rachel Menge <rachelmenge@linux.microsoft.com>,
Hardik Garg <hargar@linux.microsoft.com>,
Siddharth Chintamaneni <sidchintamaneni@gmail.com>,
Gillian Laming <glaming@microsoft.com>,
linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/2] smb: client: fix cached-dir and deferred-close unmount races
Date: Mon, 30 Nov 2026 18:11:57 +0000 [thread overview]
Message-ID: <20261130181159.93456-1-sidchintamaneni@gmail.com> (raw)
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(), filters both cfids->entries and cfids->dying
for dentries belonging to cifs_sb, 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().
Changes in v2:
- Patch 1: Filter cfids->entries and cfids->dying in
close_all_cached_dirs() for dentries belonging to cifs_sb; fix
function name in commit description.
- Patch 2: Update Fixes: tag to 340cea84f691 ("cifs: open files should
not hold ref on superblock").
[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 | 35 +++++++++++++++++++++++++++++++++--
fs/smb/client/misc.c | 32 +++++++++++++++++++++++++++++---
2 files changed, 62 insertions(+), 5 deletions(-)
--
2.43.0
next reply other threads:[~2026-11-30 18:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 18:11 Siddharth Chintamaneni [this message]
2026-11-30 18:11 ` [PATCH v2 1/2] smb: client: drop dentries for dying cached dirs during unmount Siddharth Chintamaneni
2026-11-30 18:11 ` [PATCH v2 2/2] smb: client: fix busy dentry on unmount from cancelled deferred close Siddharth Chintamaneni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130181159.93456-1-sidchintamaneni@gmail.com \
--to=sidchintamaneni@gmail.com \
--cc=apais@microsoft.com \
--cc=bharathsm@microsoft.com \
--cc=glaming@microsoft.com \
--cc=hargar@linux.microsoft.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pc@manguebit.org \
--cc=rachelmenge@linux.microsoft.com \
--cc=ronniesahlberg@gmail.com \
--cc=sprasad@microsoft.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®