summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.de>2011-09-08 17:14:32 -0700
committerDavid Sterba <dsterba@suse.cz>2012-03-22 01:45:38 +0100
commit2cdcecbc153c222fae1be6f8ddb320b29e3a5200 (patch)
tree265642879131a44f72e17c6c86d8d925178d4ace /fs/btrfs
parent305a26af5b2561a66859ef05ed7eb73d3c9f0913 (diff)
downloadop-kernel-dev-2cdcecbc153c222fae1be6f8ddb320b29e3a5200.zip
op-kernel-dev-2cdcecbc153c222fae1be6f8ddb320b29e3a5200.tar.gz
btrfs: Don't BUG_ON insert errors in btrfs_alloc_dev_extent()
The only caller of btrfs_alloc_dev_extent() is __btrfs_alloc_chunk() which already bugs on any error returned. We can remove the BUG_ON's in btrfs_alloc_dev_extent() then since __btrfs_alloc_chunk() will "catch" them anyway. Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/volumes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index c4ea7d8..281ff35 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1075,7 +1075,8 @@ int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
key.type = BTRFS_DEV_EXTENT_KEY;
ret = btrfs_insert_empty_item(trans, root, path, &key,
sizeof(*extent));
- BUG_ON(ret);
+ if (ret)
+ goto out;
leaf = path->nodes[0];
extent = btrfs_item_ptr(leaf, path->slots[0],
@@ -1090,6 +1091,7 @@ int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
btrfs_set_dev_extent_length(leaf, extent, num_bytes);
btrfs_mark_buffer_dirty(leaf);
+out:
btrfs_free_path(path);
return ret;
}
OpenPOWER on IntegriCloud