summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2011-08-10 12:32:10 -0700
committerDavid Sterba <dsterba@suse.cz>2012-03-22 01:45:37 +0100
commit4ed1d16e944c61cfb8a78159548672e7df168d97 (patch)
tree720c4087a8a79729701eb27a87b11518d0807a8f /fs/btrfs
parent0678b61851b510ba68341dff59cd9b47e1712e91 (diff)
downloadop-kernel-dev-4ed1d16e944c61cfb8a78159548672e7df168d97.zip
op-kernel-dev-4ed1d16e944c61cfb8a78159548672e7df168d97.tar.gz
btrfs: Don't BUG_ON errors in __finish_chunk_alloc()
All callers of __finish_chunk_alloc() BUG_ON() return value, so it's trivial for us to always bubble up any errors caught in __finish_chunk_alloc() to be caught there. Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/volumes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1c5f8a4..c4ea7d8 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3417,16 +3417,18 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
key.offset = chunk_offset;
ret = btrfs_insert_item(trans, chunk_root, &key, chunk, item_size);
- BUG_ON(ret);
- if (map->type & BTRFS_BLOCK_GROUP_SYSTEM) {
+ if (ret == 0 && map->type & BTRFS_BLOCK_GROUP_SYSTEM) {
+ /*
+ * TODO: Cleanup of inserted chunk root in case of
+ * failure.
+ */
ret = btrfs_add_system_chunk(chunk_root, &key, chunk,
item_size);
- BUG_ON(ret);
}
kfree(chunk);
- return 0;
+ return ret;
}
/*
OpenPOWER on IntegriCloud