Skip to content

Commit 1dd4602

Browse files
Mark Fashehkdave
authored andcommitted
btrfs: Remove BUG_ON from __btrfs_alloc_chunk()
We BUG_ON() error from add_extent_mapping(), but that error looks pretty easy to bubble back up - as far as I can tell there have not been any permanent modifications to fs state at that point. Signed-off-by: Mark Fasheh <mfasheh@suse.de>
1 parent 2cdcecb commit 1dd4602

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/btrfs/volumes.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3327,8 +3327,9 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
33273327
write_lock(&em_tree->lock);
33283328
ret = add_extent_mapping(em_tree, em);
33293329
write_unlock(&em_tree->lock);
3330-
BUG_ON(ret);
33313330
free_extent_map(em);
3331+
if (ret)
3332+
goto error;
33323333

33333334
ret = btrfs_make_block_group(trans, extent_root, 0, type,
33343335
BTRFS_FIRST_CHUNK_TREE_OBJECTID,

0 commit comments

Comments
 (0)