[PATCH v3 0/3] nvmet: avoid recursive configfs open

From: Runyu Xiao

Date: Thu Sep 10 2026 - 00:55:56 EST


The nvmet configfs store callbacks hold the item's frag_sem while they
enable file-backed namespaces or passthru controllers. Both paths open a
user-configured pathname. If it resolves into configfs, the open path can
re-enter __configfs_open_file() and try to acquire the same frag_sem again.

Add a configfs helper for identifying resolved configfs paths, then use it
from both nvmet backend open paths. The resolved path is opened directly
after the check so the backend does not perform a second pathname walk.

Changes since v2:
- Keep the filesystem type comparison in fs/configfs and export one helper.
- Use the helper from both nvmet callers.
- Use file_open_root() for already-resolved paths so standard open-time
permission checks are preserved.
- Rebase the series on Linux 7.3-rc2.

Runyu Xiao (3):
fs: configfs: add helper to identify configfs paths
nvmet: avoid recursive configfs open for file-backed namespaces
nvmet: avoid recursive configfs open for passthru

drivers/nvme/target/io-cmd-file.c | 20 +++++++++++++++++++-
drivers/nvme/target/passthru.c | 17 ++++++++++++++++-
fs/configfs/mount.c | 6 ++++++
include/linux/configfs.h | 2 ++
4 files changed, 43 insertions(+), 2 deletions(-)

--
2.34.1