From: Shakeel Butt <shakeel.butt@linux.dev>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tejun Heo <tj@kernel.org>,
Christian Brauner <christian@brauner.io>
Cc: Meta kernel team <kernel-team@meta.com>,
linux-fsdevel@vger.kernel.org, driver-core@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernfs: allocate inodes outside kernfs_rwsem
Date: Thu, 15 Oct 2026 16:38:28 -0700 [thread overview]
Message-ID: <atFhCHyRzxUTnBfn@linux.dev> (raw)
In-Reply-To: <20261015221110.3183461-1-shakeel.butt@linux.dev>
On Thu, Oct 15, 2026 at 03:11:10PM -0700, Shakeel Butt wrote:
[...]
>
> @@ -173,7 +171,7 @@ static struct dentry *kernfs_get_parent_dentry(struct dentry *child)
> struct kernfs_root *root = kernfs_root(kn);
>
> guard(rwsem_read)(&root->kernfs_rwsem);
> - return d_obtain_alias(kernfs_get_inode(child->d_sb, kernfs_parent(kn)));
> + return d_obtain_alias(kernfs_iget(child->d_sb, kernfs_parent(kn)));
Sashiko is complaining that inode allocation has been moved outside kernfs_rwsem
but d_obtain_alias() may still allocate dentry under this lock. The fix is
simple. Something like the following:
scoped_guard(rwsem_read, &root->kernfs_rwsem)
inode = kernfs_iget(child->d_sb, kernfs_parent(kn));
return d_obtain_alias(inode);
I am testing this change and I will wait for human response/review before
sending out the v2 of this patch.
prev parent reply other threads:[~2026-10-15 23:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 22:11 [PATCH] kernfs: allocate inodes outside kernfs_rwsem Shakeel Butt
2026-10-15 23:38 ` Shakeel Butt [this message]
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=atFhCHyRzxUTnBfn@linux.dev \
--to=shakeel.butt@linux.dev \
--cc=christian@brauner.io \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@meta.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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