mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeel.butt@linux.dev>
To: Jori Koolstra <jkoolstra@xs4all.nl>
Cc: Christian Brauner <brauner@kernel.org>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tejun Heo <tj@kernel.org>,
	 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 v4] kernfs: allocate inodes and dentry outside kernfs_rwsem
Date: Thu, 12 Nov 2026 05:29:48 -0800	[thread overview]
Message-ID: <avW_E0stwo6e-y58@linux.dev> (raw)
In-Reply-To: <1984940723.1098701.1794483492769@kpc.webmail.kpnmail.nl>

On Thu, Nov 12, 2026 at 12:38:12PM +0100, Jori Koolstra wrote:
> 
> > Op 11-11-2026 16:50 EST schreef Shakeel Butt <shakeel.butt@linux.dev>:
> > 
> >  
[...]
> > +	new = new_inode(sb);
> > +	if (!new)
> > +		return -ENOMEM;
> >  	down_read(&kf_root->kernfs_rwsem);
> > -	inode = kernfs_get_inode(sb, info->root->kn);
> > +	inode = kernfs_get_inode_locked(new, info->root->kn);
> >  	up_read(&kf_root->kernfs_rwsem);
> >  	if (!inode) {
> >  		pr_debug("kernfs: could not get root inode\n");
> > 
> > base-commit: ecdfc51a6a78aaf1c4ac1d8b6ea199cc2ed020ac
> > -- 
> > 2.53.0-Meta
> 
> Does this compile? I added a bool parameter to kernfs_get_inode_locked(),
> for this patch to be able to do a lookup first, but you haven't added that.
> I think you want to set lookup=true everywhere, right?
> 

Yes, it builds on vfs-7.5.directory (base-commit ecdfc51a6a78).
Christian's fixup there dropped @lookup, so kernfs_get_inode_locked()
now takes just (inode, kn).

I don't think this patch needs @lookup.  inode_insert5() already
returns an inode that is already hashed, so an ilookup() first only
changes things for an inactive node.  Lookup and the fh_to_* paths
only get there with an active node, under the same kernfs_rwsem hold,
and fill_super works on a new superblock.  In ->get_parent, an
inactive parent means the directory being decoded is being removed.
reconnect_one() then returns -ESTALE either way, because readdir
skips the removed child.

      reply	other threads:[~2026-11-12 13:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 21:50 Shakeel Butt
2026-11-12 11:38 ` Jori Koolstra
2026-11-12 13:29   ` 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=avW_E0stwo6e-y58@linux.dev \
    --to=shakeel.butt@linux.dev \
    --cc=brauner@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=jkoolstra@xs4all.nl \
    --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

all inboxes | Powered by JetHome®