From: Al Viro <viro@zeniv.linux.org.uk>
To: Ian Kent <raven@themaw.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tejun Heo <tj@kernel.org>, Brice Goglin <brice.goglin@gmail.com>,
Fox Chen <foxhlchen@gmail.com>,
Rick Lindsley <ricklind@linux.vnet.ibm.com>,
Miklos Szeredi <miklos@szeredi.hu>,
David Howells <dhowells@redhat.com>,
Eric Sandeen <sandeen@sandeen.net>,
Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v3 2/4] kernfs: use VFS negative dentry caching
Date: Fri, 9 Apr 2021 01:35:05 +0000 [thread overview]
Message-ID: <YG+vSdNLmgwXrwgJ@zeniv-ca.linux.org.uk> (raw)
In-Reply-To: <161793090597.10062.4954029445418116308.stgit@mickey.themaw.net>
On Fri, Apr 09, 2021 at 09:15:06AM +0800, Ian Kent wrote:
> + parent = kernfs_dentry_node(dentry->d_parent);
> + if (parent) {
> + const void *ns = NULL;
> +
> + if (kernfs_ns_enabled(parent))
> + ns = kernfs_info(dentry->d_parent->d_sb)->ns;
For any dentry d, we have d->d_parent->d_sb == d->d_sb. All the time.
If you ever run into the case where that would not be true, you've found
a critical bug.
> + kn = kernfs_find_ns(parent, dentry->d_name.name, ns);
> + if (kn)
> + goto out_bad;
> + }
Umm... What's to prevent a race with successful rename(2)? IOW, what's
there to stabilize ->d_parent and ->d_name while we are in that function?
next prev parent reply other threads:[~2021-04-09 1:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 1:14 [PATCH v3 0/4] kernfs: proposed locking and concurrency improvement Ian Kent
2021-04-09 1:14 ` [PATCH v3 1/4] kernfs: move revalidate to be near lookup Ian Kent
2021-04-09 3:39 ` kernel test robot
2021-04-09 1:15 ` [PATCH v3 2/4] kernfs: use VFS negative dentry caching Ian Kent
2021-04-09 1:35 ` Al Viro [this message]
2021-04-09 8:26 ` Ian Kent
2021-04-09 9:34 ` Ian Kent
2021-04-09 1:15 ` [PATCH v3 3/4] kernfs: switch kernfs to use an rwsem Ian Kent
2021-04-09 1:15 ` [PATCH v3 4/4] kernfs: use i_lock to protect concurrent inode updates Ian Kent
2021-04-19 7:56 ` [PATCH v3 0/4] kernfs: proposed locking and concurrency improvement Fox Chen
2021-04-19 12:25 ` Ian Kent
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=YG+vSdNLmgwXrwgJ@zeniv-ca.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=brice.goglin@gmail.com \
--cc=dhowells@redhat.com \
--cc=foxhlchen@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=raven@themaw.net \
--cc=ricklind@linux.vnet.ibm.com \
--cc=sandeen@sandeen.net \
--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®