Skip to content

Commit

Permalink
btrfs: Remove BUG_ON from __btrfs_alloc_chunk()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Mark Fasheh authored and kdave committed Mar 22, 2012
1 parent 2cdcecb commit 1dd4602
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3327,8 +3327,9 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
write_lock(&em_tree->lock);
ret = add_extent_mapping(em_tree, em);
write_unlock(&em_tree->lock);
BUG_ON(ret);
free_extent_map(em);
if (ret)
goto error;

ret = btrfs_make_block_group(trans, extent_root, 0, type,
BTRFS_FIRST_CHUNK_TREE_OBJECTID,
Expand Down

0 comments on commit 1dd4602

Please sign in to comment.