aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik2022-02-23 14:06:43 -0500
committerDavid Sterba2022-03-14 13:13:53 +0100
commitb3c958a3694eb8280de9ee3b241ced03bce5ad5f (patch)
tree88c1648f8b7ecfd1838ef244ffa077c35345cc57 /fs/btrfs
parent313ab75399d0c7d0ebc718c545572c1b4d8d22ef (diff)
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index b7b49b4eb68d..23edecb5b405 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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,