From: Shakeel Butt <shakeel.butt@linux.dev>
To: Tejun Heo <tj@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Christian Brauner <christian@brauner.io>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
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 2/3] kernfs: don't hold kernfs_rwsem across dir_emit()
Date: Fri, 11 Sep 2026 10:58:53 -0700 [thread overview]
Message-ID: <aqRBPn7dzTMSNpcp@linux.dev> (raw)
In-Reply-To: <10a6491d3de9cd67dbeccda8bee4ae7c@kernel.org>
On Thu, Sep 10, 2026 at 10:24:18AM -1000, Tejun Heo wrote:
> Hello, Shakeel.
>
> On Wed, Sep 09, 2026 at 05:36:49PM -0700, Shakeel Butt wrote:
> > under the lock and emit the copy, and pass it to the resume so that a
> > resume within one call keys on (hash, ns_id, name) and not on the hash
> > alone.
>
> Please split this into a preparation patch for full-key resumption,
> including the name copy, and a separate patch dropping kernfs_rwsem around
> dir_emit(). Keep the existing locking in the preparation patch.
>
> > + pos = kernfs_dir_pos(ns, parent, hash, pos, name, &resumed);
>
> The fast path in kernfs_dir_pos() still accepts the pinned node based on
> active state, parent and hash alone. Please compare the saved name too
> before setting resumed.
>
> For example, akl, ala and baa have the same kernfs hash. If readdir emits
> akl and it is renamed to baa while unlocked, the fast path accepts the
> renamed node and rb_next() skips the unchanged ala. Falling back to the
> saved key would preserve ala.
>
Sounds good, will make these changes in v2. Thanks for taking a look.
next prev parent reply other threads:[~2026-09-11 17:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 0:36 [PATCH 0/3] " Shakeel Butt
2026-09-10 0:36 ` [PATCH 1/3] kernfs: don't repeat or skip an entry when readdir resumes Shakeel Butt
2026-09-10 20:15 ` Tejun Heo
2026-09-10 0:36 ` [PATCH 2/3] kernfs: don't hold kernfs_rwsem across dir_emit() Shakeel Butt
2026-09-10 20:24 ` Tejun Heo
2026-09-11 17:58 ` Shakeel Butt [this message]
2026-09-10 0:36 ` [PATCH 3/3] selftests: cover readdir resuming at a removed entry Shakeel Butt
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=aqRBPn7dzTMSNpcp@linux.dev \
--to=shakeel.butt@linux.dev \
--cc=bigeasy@linutronix.de \
--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
all inboxes | Powered by JetHome®