From: Christoph Hellwig <hch@infradead.org>
To: Christian Brauner <brauner@kernel.org>
Cc: Qing Zhang <diasyzhangqing@gmail.com>,
viro@zeniv.linux.org.uk, jack@suse.cz, raven@themaw.net,
djwong@kernel.org, linux-fsdevel@vger.kernel.org,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Dave Chinner <dgc@kernel.org>
Subject: Re: [RFC PATCH] namei: revalidate the symlink dentry before invoking get_link in RCU-walk
Date: Fri, 20 Nov 2026 08:24:36 -0800 [thread overview]
Message-ID: <awB0RE6WN_v4YBbn@infradead.org> (raw)
In-Reply-To: <20261120-desillusionieren-holzhammer-mieten-8ec8551ef2b0@brauner>
On Fri, Nov 20, 2026 at 02:59:42PM +0100, Christian Brauner wrote:
> This only makes the window smaller.
>
> XFS can still reinitialize the inode right after this check and while
> get() is running. Then ->get_link() operates on an inode that is being
> reset underneath it. And the !get check only catches the case where the
> that re-init already finished before we loaded ->get_link.
>
> RCU pathwalk relies on inode memory not being reused before a grace
> period has passed. XFS itself frees inodes via call_rcu() but the
> recycle path hands the same struct inode out again without waiting for
> existing RCU walkers.
>
> So that should be fixed in XFS, either by not recycling an inode in
> place while RCU walkers can still see it or by keeping i_op and the link
> state valid across a recycle.
Not recycling the inode really isn't an option, as that means there
would cause duplicate inodes in the xfs inode cache. Keeping i_op and
state in place sounds a bit more feasibly, but could be iffy as well.
The best thing would be to find a way to keep the inode alive at the VFS
level when XFS marks it reclaimable. That would be a huge an invasive
change, but it would solve this and many other problems as well.
A good reproducer for the issue would help either way.
prev parent reply other threads:[~2026-11-20 16:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 8:39 [RFC PATCH] namei: revalidate the symlink dentry before invoking get_link in RCU-walk Qing Zhang
2026-11-20 13:59 ` Christian Brauner
2026-11-20 16:24 ` Christoph Hellwig [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=awB0RE6WN_v4YBbn@infradead.org \
--to=hch@infradead.org \
--cc=brauner@kernel.org \
--cc=dgc@kernel.org \
--cc=diasyzhangqing@gmail.com \
--cc=djwong@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=raven@themaw.net \
--cc=viro@zeniv.linux.org.uk \
/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