mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-21 05:00:44 +00:00
btrfs-progs: exit gracefully if we hit ENOSPC when allocating tree block
When running test fuzz/003, we could hit the following BUG_ON: ====== RUN MAYFAIL btrfs check --init-csum-tree tests//fuzz-tests/images/bko-155621-bad-block-group-offset.raw.restored Unable to find block group for 0 Unable to find block group for 0 Unable to find block group for 0 extent-tree.c:2657: alloc_tree_block: BUG_ON `ret` triggered, value -28 failed (ignored, ret=134): btrfs check --init-csum-tree tests/fuzz-tests/images/bko-155621-bad-block-group-offset.raw.restored mayfail: returned code 134 (SIGABRT), not ignored test failed for case 003-multi-check-unmounted Just remove that BUG_ON() and allow us to exit gracefully, the caller handles the errors. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
739313d223
commit
f2cd3f394b
@ -2740,7 +2740,8 @@ static int alloc_tree_block(struct btrfs_trans_handle *trans,
|
||||
int ret;
|
||||
ret = btrfs_reserve_extent(trans, root, num_bytes, empty_size,
|
||||
hint_byte, search_end, ins, 0);
|
||||
BUG_ON(ret);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (root_objectid == BTRFS_EXTENT_TREE_OBJECTID) {
|
||||
struct pending_extent_op *extent_op;
|
||||
|
Loading…
Reference in New Issue
Block a user