Skip to content

Commit

Permalink
btrfs: remove BUG_ON(ret) in alloc_reserved_tree_block
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Josef Bacik authored and David Sterba committed Mar 14, 2022
1 parent 313ab75 commit b3c958a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4761,9 +4761,10 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
ret = btrfs_update_block_group(trans, extent_key.objectid,
fs_info->nodesize, true);
if (ret) { /* -ENOENT, logic error */
ASSERT(!ret);
btrfs_err(fs_info, "update block group failed for %llu %llu",
extent_key.objectid, extent_key.offset);
BUG();
return ret;
}

trace_btrfs_reserved_extent_alloc(fs_info, extent_key.objectid,
Expand Down

0 comments on commit b3c958a

Please sign in to comment.