lkml.org 
[lkml]   [2021]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH v8 5/5] kernfs: dont call d_splice_alias() under kernfs node lock
    From
    Date
    The call to d_splice_alias() in kernfs_iop_lookup() doesn't depend on
    any kernfs node so there's no reason to hold the kernfs node lock when
    calling it.

    Signed-off-by: Ian Kent <raven@themaw.net>
    Reviewed-by: Miklos Szeredi <mszeredi@redhat.com>
    ---
    fs/kernfs/dir.c | 6 ++----
    1 file changed, 2 insertions(+), 4 deletions(-)

    diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
    index 4994723d6cf7..ba581429bf7b 100644
    --- a/fs/kernfs/dir.c
    +++ b/fs/kernfs/dir.c
    @@ -1100,7 +1100,6 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir,
    struct dentry *dentry,
    unsigned int flags)
    {
    - struct dentry *ret;
    struct kernfs_node *parent = dir->i_private;
    struct kernfs_node *kn;
    struct inode *inode = NULL;
    @@ -1120,11 +1119,10 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir,
    /* Needed only for negative dentry validation */
    if (!inode)
    kernfs_set_rev(parent, dentry);
    - /* instantiate and hash (possibly negative) dentry */
    - ret = d_splice_alias(inode, dentry);
    up_read(&kernfs_rwsem);

    - return ret;
    + /* instantiate and hash (possibly negative) dentry */
    + return d_splice_alias(inode, dentry);
    }

    static int kernfs_iop_mkdir(struct user_namespace *mnt_userns,

    \
     
     \ /
      Last update: 2021-07-16 11:38    [W:3.011 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site