Merge branch 'work.lookup' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[platform/kernel/linux-starfive.git] / fs / btrfs / inode.c
index f22f771..181c58b 100644 (file)
@@ -5764,16 +5764,10 @@ static int btrfs_dentry_delete(const struct dentry *dentry)
 static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,
                                   unsigned int flags)
 {
-       struct inode *inode;
-
-       inode = btrfs_lookup_dentry(dir, dentry);
-       if (IS_ERR(inode)) {
-               if (PTR_ERR(inode) == -ENOENT)
-                       inode = NULL;
-               else
-                       return ERR_CAST(inode);
-       }
+       struct inode *inode = btrfs_lookup_dentry(dir, dentry);
 
+       if (inode == ERR_PTR(-ENOENT))
+               inode = NULL;
        return d_splice_alias(inode, dentry);
 }