mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
btrfs: replace BUG_ON with ASSERT in btrfs_read_node_slot
In btrfs_read_node_slot() we have a BUG_ON() that can be converted to an ASSERT(), it's from an extent buffer and the level is validated at the time it's read from disk. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
13b98989c8
commit
d469472844
@ -959,7 +959,7 @@ struct extent_buffer *btrfs_read_node_slot(struct extent_buffer *parent,
|
||||
if (slot < 0 || slot >= btrfs_header_nritems(parent))
|
||||
return ERR_PTR(-ENOENT);
|
||||
|
||||
BUG_ON(level == 0);
|
||||
ASSERT(level);
|
||||
|
||||
check.level = level - 1;
|
||||
check.transid = btrfs_node_ptr_generation(parent, slot);
|
||||
|
Loading…
Reference in New Issue
Block a user