mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Christian Brauner <christian@brauner.io>,
	Tejun Heo <tj@kernel.org>,
	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: Thu, 10 Sep 2026 10:24:18 -1000	[thread overview]
Message-ID: <10a6491d3de9cd67dbeccda8bee4ae7c@kernel.org> (raw)
In-Reply-To: <20260910003650.1680854-3-shakeel.butt@linux.dev>

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.

Thanks.

-- 
tejun

  reply	other threads:[~2026-09-10 20:26 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 [this message]
2026-09-11 17:58     ` Shakeel Butt
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=10a6491d3de9cd67dbeccda8bee4ae7c@kernel.org \
    --to=tj@kernel.org \
    --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=shakeel.butt@linux.dev \
    /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®