Skip to content

Commit b3c958a

Browse files
josefbacikkdave
authored andcommitted
btrfs: remove BUG_ON(ret) in alloc_reserved_tree_block
Switch this to an ASSERT() and return the error in the normal case. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 313ab75 commit b3c958a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/btrfs/extent-tree.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4761,9 +4761,10 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
47614761
ret = btrfs_update_block_group(trans, extent_key.objectid,
47624762
fs_info->nodesize, true);
47634763
if (ret) { /* -ENOENT, logic error */
4764+
ASSERT(!ret);
47644765
btrfs_err(fs_info, "update block group failed for %llu %llu",
47654766
extent_key.objectid, extent_key.offset);
4766-
BUG();
4767+
return ret;
47674768
}
47684769

47694770
trace_btrfs_reserved_extent_alloc(fs_info, extent_key.objectid,

0 commit comments

Comments
 (0)