summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorMark Fasheh2011-09-09 02:29:00 +0200
committerDavid Sterba2012-03-22 01:45:39 +0100
commit1dd4602fa74273c28b3577a58aa389f330e9a0dc (patch)
treec506007911ac9aa210a7e2b66a19ea49da72b8a5 /fs/btrfs/volumes.c
parentbtrfs: Don't BUG_ON insert errors in btrfs_alloc_dev_extent() (diff)
downloadkernel-qcow2-linux-1dd4602fa74273c28b3577a58aa389f330e9a0dc.tar.gz
kernel-qcow2-linux-1dd4602fa74273c28b3577a58aa389f330e9a0dc.tar.xz
kernel-qcow2-linux-1dd4602fa74273c28b3577a58aa389f330e9a0dc.zip
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>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 281ff354f64f..f002973959d0 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -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,