lkml.org 
[lkml]   [2021]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/4] kernfs: use VFS negative dentry caching
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?

\
 
 \ /
  Last update: 2021-04-09 03:36    [W:0.075 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site