Commit 06bbf672 authored by Qu Wenruo's avatar Qu Wenruo Committed by David Sterba

btrfs: relocation: Remove redundant tree level check

Commit 581c1760 ("btrfs: Validate child tree block's level and first
key") has made tree block level check mandatory.

So if tree block level doesn't match, we won't get a valid extent
buffer.  The extra WARN_ON() check can be removed completely.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 98ff7b94
...@@ -2915,7 +2915,6 @@ static int get_tree_block_key(struct btrfs_fs_info *fs_info, ...@@ -2915,7 +2915,6 @@ static int get_tree_block_key(struct btrfs_fs_info *fs_info,
free_extent_buffer(eb); free_extent_buffer(eb);
return -EIO; return -EIO;
} }
WARN_ON(btrfs_header_level(eb) != block->level);
if (block->level == 0) if (block->level == 0)
btrfs_item_key_to_cpu(eb, &block->key, 0); btrfs_item_key_to_cpu(eb, &block->key, 0);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment