adam900710 btrfs: volumes: Revert device used bytes when calc_per_profile_avail(…
1b42f25 Feb 21, 2020
btrfs: volumes: Revert device used bytes when calc_per_profile_avail(…
…) failed

In __btrfs_alloc_chunk(), if calc_per_profile_avail() failed, it will
not update the per-profile available space array.
However since device used space is already updated, this would cause a
mismatch between them.

To fix this problem, this patch will revert device used bytes when
calc_per_profile_avail() failed, and remove the newly allocated chunk.

Signed-off-by: Qu Wenruo <wqu@suse.com>
1b42f25