Skip to content

Commit 3acd395

Browse files
Mark Fashehkdave
authored andcommitted
btrfs: Remove BUG_ON from __finish_chunk_alloc()
btrfs_alloc_chunk() unconditionally BUGs on any error returned from __finish_chunk_alloc() so there's no need for two BUG_ON lines. Remove the one from __finish_chunk_alloc(). Signed-off-by: Mark Fasheh <mfasheh@suse.de>
1 parent 1dd4602 commit 3acd395

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/btrfs/volumes.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3383,7 +3383,8 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
33833383
device = map->stripes[index].dev;
33843384
device->bytes_used += stripe_size;
33853385
ret = btrfs_update_device(trans, device);
3386-
BUG_ON(ret);
3386+
if (ret)
3387+
goto out_free;
33873388
index++;
33883389
}
33893390

@@ -3430,6 +3431,7 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
34303431
item_size);
34313432
}
34323433

3434+
out_free:
34333435
kfree(chunk);
34343436
return ret;
34353437
}

0 commit comments

Comments
 (0)