btrfs: adjust return values of btrfs_inode_by_name
authorSu Yue <suy.fnst@cn.fujitsu.com>
Mon, 5 Mar 2018 09:13:37 +0000 (17:13 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Mar 2018 13:09:43 +0000 (15:09 +0200)
commit005d67127fa9dfb3382f2c9e918feed7a243a7fe
tree8189d9865dc9d25b6a0de86f2ee7bf778126c39b
parent9b99b11564446600f3a3ce394a841d525b7993e7
btrfs: adjust return values of btrfs_inode_by_name

Previously, btrfs_inode_by_name() returned 0 which left caller to check
objectid of location even location if the type was invalid.

Let btrfs_inode_by_name() return -EUCLEAN if a corrupted location of a
dir entry is found.  Removal of label out_err also simplifies the
function.

Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ drop unlikely ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c