]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nilfs2: d_obtain_alias(ERR_PTR(...)) will do the right thing...
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 11 Nov 2023 06:55:03 +0000 (01:55 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 20 Dec 2023 17:08:43 +0000 (12:08 -0500)
Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/nilfs2/namei.c

index 2a4e7f4a8102f6115f7ce30212fed60e7705a22d..8e8c7c981a7ab89bedbad6dc2864e55044ae605a 100644 (file)
@@ -439,7 +439,6 @@ out:
 static struct dentry *nilfs_get_parent(struct dentry *child)
 {
        unsigned long ino;
-       struct inode *inode;
        struct nilfs_root *root;
 
        ino = nilfs_inode_by_name(d_inode(child), &dotdot_name);
@@ -448,11 +447,7 @@ static struct dentry *nilfs_get_parent(struct dentry *child)
 
        root = NILFS_I(d_inode(child))->i_root;
 
-       inode = nilfs_iget(child->d_sb, root, ino);
-       if (IS_ERR(inode))
-               return ERR_CAST(inode);
-
-       return d_obtain_alias(inode);
+       return d_obtain_alias(nilfs_iget(child->d_sb, root, ino));
 }
 
 static struct dentry *nilfs_get_dentry(struct super_block *sb, u64 cno,