diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-08-01 14:27:34 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-08-01 14:27:34 -0400 |
commit | b43b31bdf2e662006c27cc4dcccf863312d62bc1 (patch) | |
tree | 9e12413edbd9d7a77e4c0b692dd28ca4ae5039bd /fs/btrfs/volumes.c | |
parent | ff95acb6733d41a8d45feb0e18b96df25e610e78 (diff) | |
parent | 38a1a919535742af677303271eb4ff731547b706 (diff) | |
download | blackbird-op-linux-b43b31bdf2e662006c27cc4dcccf863312d62bc1.tar.gz blackbird-op-linux-b43b31bdf2e662006c27cc4dcccf863312d62bc1.zip |
Merge branch 'alloc_path' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/btrfs-error-handling into for-linus
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index b89e372c7544..53875ae73ad4 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1037,7 +1037,8 @@ static noinline int find_next_chunk(struct btrfs_root *root, struct btrfs_key found_key; path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) + return -ENOMEM; key.objectid = objectid; key.offset = (u64)-1; @@ -2061,8 +2062,10 @@ int btrfs_balance(struct btrfs_root *dev_root) /* step two, relocate all the chunks */ path = btrfs_alloc_path(); - BUG_ON(!path); - + if (!path) { + ret = -ENOMEM; + goto error; + } key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID; key.offset = (u64)-1; key.type = BTRFS_CHUNK_ITEM_KEY; @@ -2661,7 +2664,8 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans, ret = find_next_chunk(fs_info->chunk_root, BTRFS_FIRST_CHUNK_TREE_OBJECTID, &chunk_offset); - BUG_ON(ret); + if (ret) + return ret; alloc_profile = BTRFS_BLOCK_GROUP_METADATA | (fs_info->metadata_alloc_profile & |