mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>,
	Andreas Hindborg <a.hindborg@kernel.org>,
	Breno Leitao <leitao@debian.org>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, Jianhao Xu <jianhao.xu@seu.edu.cn>
Subject: Re: [PATCH v4 1/3] fs: configfs: add helpers for opening non-configfs paths
Date: Tue, 22 Sep 2026 15:29:03 +0200	[thread overview]
Message-ID: <20260922132903.GA31642@lst.de> (raw)
In-Reply-To: <20260921090559.41364-2-runyu.xiao@seu.edu.cn>

On Mon, Sep 21, 2026 at 05:05:57PM +0800, Runyu Xiao wrote:
> +bool configfs_path_is_configfs(const struct path *path)
> +{
> +	return path->dentry->d_sb->s_type == &configfs_fs_type;
> +}
> +EXPORT_SYMBOL_GPL(configfs_path_is_configfs);
> +
> +struct file *configfs_open_root(const struct path *root, const char *name,
> +				int flags, umode_t mode)
> +{
> +	if (configfs_path_is_configfs(root))
> +		return ERR_PTR(-EINVAL);
> +
> +	return file_open_root(root, name, flags, mode);
> +}
> +EXPORT_SYMBOL_GPL(configfs_open_root);

These two aren't used outside this file, so they could be static,
or in case of configfs_path_is_configfs even be folded into the
only caller.  Or do you plan to have other users?

> +struct file *configfs_file_open(const char *filename, int flags, umode_t mode)

Can you add a kerneldoc comment explaining how/why this should be used?


  reply	other threads:[~2026-09-22 13:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21  9:05 [PATCH v4 0/3] nvmet: avoid recursive configfs open Runyu Xiao
2026-09-21  9:05 ` [PATCH v4 1/3] fs: configfs: add helpers for opening non-configfs paths Runyu Xiao
2026-09-22 13:29   ` Christoph Hellwig [this message]
2026-09-23  2:39     ` Runyu Xiao
2026-09-21  9:05 ` [PATCH v4 2/3] nvmet: avoid recursive configfs open for file-backed namespaces Runyu Xiao
2026-09-22 13:29   ` Christoph Hellwig
2026-09-21  9:05 ` [PATCH v4 3/3] nvmet: avoid recursive configfs open for passthru Runyu Xiao
2026-09-22 13:29   ` Christoph Hellwig

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=20260922132903.GA31642@lst.de \
    --to=hch@lst.de \
    --cc=a.hindborg@kernel.org \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=kch@nvidia.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --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

all inboxes | Powered by JetHome®