btrfs-progs: mkfs: Use the whole file or block device to mkfs for rootdir
[platform/upstream/btrfs-progs.git] / extent-tree.c
index 525a237..055582c 100644 (file)
@@ -2690,7 +2690,8 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
                               search_start, search_end, hint_byte, ins,
                               trans->alloc_exclude_start,
                               trans->alloc_exclude_nr, data);
-       BUG_ON(ret);
+       if (ret < 0)
+               return ret;
        clear_extent_dirty(&info->free_space_cache,
                           ins->objectid, ins->objectid + ins->offset - 1);
        return ret;