|
@@ -1037,7 +1037,8 @@ static noinline int find_next_chunk(struct btrfs_root *root,
|
|
struct btrfs_key found_key;
|
|
struct btrfs_key found_key;
|
|
|
|
|
|
path = btrfs_alloc_path();
|
|
path = btrfs_alloc_path();
|
|
- BUG_ON(!path);
|
|
|
|
|
|
+ if (!path)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
|
|
key.objectid = objectid;
|
|
key.objectid = objectid;
|
|
key.offset = (u64)-1;
|
|
key.offset = (u64)-1;
|
|
@@ -2663,7 +2664,8 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
|
|
|
|
|
|
ret = find_next_chunk(fs_info->chunk_root,
|
|
ret = find_next_chunk(fs_info->chunk_root,
|
|
BTRFS_FIRST_CHUNK_TREE_OBJECTID, &chunk_offset);
|
|
BTRFS_FIRST_CHUNK_TREE_OBJECTID, &chunk_offset);
|
|
- BUG_ON(ret);
|
|
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
|
|
alloc_profile = BTRFS_BLOCK_GROUP_METADATA |
|
|
alloc_profile = BTRFS_BLOCK_GROUP_METADATA |
|
|
(fs_info->metadata_alloc_profile &
|
|
(fs_info->metadata_alloc_profile &
|