summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorSu Yue <suy.fnst@cn.fujitsu.com>2018-06-22 16:18:01 +0800
committerDavid Sterba <dsterba@suse.com>2018-08-06 13:12:40 +0200
commitaf431dcb249ffff20b16e08adaa4b624405a046b (patch)
tree1dbe1dcb6d6c72ffd7fe1a587720b41e7ae0bf5e /fs/btrfs/relocation.c
parente4af400a9c5081e7d2b703e4c479cb9831cc1117 (diff)
downloadlinux-stable-af431dcb249ffff20b16e08adaa4b624405a046b.tar.gz
linux-stable-af431dcb249ffff20b16e08adaa4b624405a046b.tar.bz2
linux-stable-af431dcb249ffff20b16e08adaa4b624405a046b.zip
btrfs: return EUCLEAN if extent_inline_ref type is invalid
If type of extent_inline_ref found is not expected, filesystem may have been corrupted, should return EUCLEAN instead of EINVAL. Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 22214033a4a2..44722e939e34 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -792,7 +792,7 @@ again:
type = btrfs_get_extent_inline_ref_type(eb, iref,
BTRFS_REF_TYPE_BLOCK);
if (type == BTRFS_REF_TYPE_INVALID) {
- err = -EINVAL;
+ err = -EUCLEAN;
goto out;
}
key.type = type;
@@ -3801,7 +3801,7 @@ int add_data_references(struct reloc_control *rc,
ret = find_data_references(rc, extent_key,
eb, dref, blocks);
} else {
- ret = -EINVAL;
+ ret = -EUCLEAN;
btrfs_err(rc->extent_root->fs_info,
"extent %llu slot %d has an invalid inline ref type",
eb->start, path->slots[0]);