diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c07433072322..b74a831fab19 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -847,15 +847,16 @@ static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry, | |||
847 | struct btrfs_dir_item *di; | 847 | struct btrfs_dir_item *di; |
848 | struct btrfs_path *path; | 848 | struct btrfs_path *path; |
849 | struct btrfs_root *root = BTRFS_I(dir)->root; | 849 | struct btrfs_root *root = BTRFS_I(dir)->root; |
850 | int ret; | 850 | int ret = 0; |
851 | 851 | ||
852 | path = btrfs_alloc_path(); | 852 | path = btrfs_alloc_path(); |
853 | BUG_ON(!path); | 853 | BUG_ON(!path); |
854 | di = btrfs_lookup_dir_item(NULL, root, path, dir->i_ino, name, | 854 | di = btrfs_lookup_dir_item(NULL, root, path, dir->i_ino, name, |
855 | namelen, 0); | 855 | namelen, 0); |
856 | if (IS_ERR(di)) | ||
857 | ret = PTR_ERR(di); | ||
856 | if (!di || IS_ERR(di)) { | 858 | if (!di || IS_ERR(di)) { |
857 | location->objectid = 0; | 859 | location->objectid = 0; |
858 | ret = 0; | ||
859 | goto out; | 860 | goto out; |
860 | } | 861 | } |
861 | btrfs_dir_item_key_to_cpu(path->nodes[0], di, location); | 862 | btrfs_dir_item_key_to_cpu(path->nodes[0], di, location); |