Merge tag 'for-4.20-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[linux-block.git] / fs / btrfs / inode.c
index e71daadd2f75a00ea54f96489fecf7c072f6bbb3..9ea4c6f0352f06e828a400890c50122c7ec33ee5 100644 (file)
@@ -5786,16 +5786,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);
 }