From: Christoph Hellwig <hch@lst.de>
To: Runyu Xiao <runyu.xiao@seu.edu.cn>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
Keith Busch <kbusch@kernel.org>,
Logan Gunthorpe <logang@deltatee.com>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Jianhao Xu <jianhao.xu@seu.edu.cn>
Subject: Re: [PATCH 1/2] nvmet: avoid recursive configfs open for file-backed namespaces
Date: Wed, 19 Aug 2026 07:46:50 +0200 [thread overview]
Message-ID: <20260819054650.GB32649@lst.de> (raw)
In-Reply-To: <20260817143714.1344255-2-runyu.xiao@seu.edu.cn>
> + ret = kern_path(ns->device_path, LOOKUP_FOLLOW, &path);
> + if (ret) {
> + pr_err("failed to open file %s: (%d)\n",
> + ns->device_path, ret);
> + return ret;
> + }
> +
> + if (!strcmp(path.dentry->d_sb->s_type->name, "configfs")) {
> + pr_err("configfs paths cannot back namespace %s\n",
> + ns->device_path);
> + path_put(&path);
> + return -EINVAL;
> + }
String comparisons are a bit weird, checking the actual file_system_type
is a lot cheaper and more safe. And please move this into a helper
in configfs as I bet there are tons of other users like this and they'd
benefit fro ma common helper.
next prev parent reply other threads:[~2026-08-19 5:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 14:37 [PATCH 0/2] nvmet: avoid configfs recursion when enabling backends Runyu Xiao
2026-08-17 14:37 ` [PATCH 1/2] nvmet: avoid recursive configfs open for file-backed namespaces Runyu Xiao
2026-08-19 5:46 ` Christoph Hellwig [this message]
2026-08-17 14:37 ` [PATCH 2/2] nvmet: avoid recursive configfs open for passthru Runyu Xiao
2026-08-19 15:52 ` [PATCH v2 0/3] nvmet: avoid recursive configfs open Runyu Xiao
2026-08-19 15:52 ` [PATCH v2 1/3] fs: configfs: add helper to identify configfs paths Runyu Xiao
2026-08-23 0:24 ` Sagi Grimberg
2026-08-19 15:52 ` [PATCH v2 2/3] nvmet: avoid recursive configfs open for file-backed namespaces Runyu Xiao
2026-08-23 0:24 ` Sagi Grimberg
2026-08-19 15:52 ` [PATCH v2 3/3] nvmet: avoid recursive configfs open for passthru Runyu Xiao
2026-08-23 0:24 ` Sagi Grimberg
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=20260819054650.GB32649@lst.de \
--to=hch@lst.de \
--cc=jianhao.xu@seu.edu.cn \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=logang@deltatee.com \
--cc=runyu.xiao@seu.edu.cn \
--cc=sagi@grimberg.me \
--cc=stable@vger.kernel.org \
/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