diff options
author | Mark Fasheh <mfasheh@suse.com> | 2011-08-10 15:32:10 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-03-21 20:45:37 -0400 |
commit | 4ed1d16e944c61cfb8a78159548672e7df168d97 (patch) | |
tree | 720c4087a8a79729701eb27a87b11518d0807a8f /fs/btrfs/volumes.c | |
parent | 0678b61851b510ba68341dff59cd9b47e1712e91 (diff) |
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/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 1c5f8a4a2bbd..c4ea7d8bea0f 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, | |||
3417 | key.offset = chunk_offset; | 3417 | key.offset = chunk_offset; |
3418 | 3418 | ||
3419 | ret = btrfs_insert_item(trans, chunk_root, &key, chunk, item_size); | 3419 | ret = btrfs_insert_item(trans, chunk_root, &key, chunk, item_size); |
3420 | BUG_ON(ret); | ||
3421 | 3420 | ||
3422 | if (map->type & BTRFS_BLOCK_GROUP_SYSTEM) { | 3421 | if (ret == 0 && map->type & BTRFS_BLOCK_GROUP_SYSTEM) { |
3422 | /* | ||
3423 | * TODO: Cleanup of inserted chunk root in case of | ||
3424 | * failure. | ||
3425 | */ | ||
3423 | ret = btrfs_add_system_chunk(chunk_root, &key, chunk, | 3426 | ret = btrfs_add_system_chunk(chunk_root, &key, chunk, |
3424 | item_size); | 3427 | item_size); |
3425 | BUG_ON(ret); | ||
3426 | } | 3428 | } |
3427 | 3429 | ||
3428 | kfree(chunk); | 3430 | kfree(chunk); |
3429 | return 0; | 3431 | return ret; |
3430 | } | 3432 | } |
3431 | 3433 | ||
3432 | /* | 3434 | /* |