bcachefs: Make sure bch2_bucket_alloc_new_fs() obeys buckets_nouse

This fixes the filesystem migrate tool.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2021-12-20 12:53:06 -05:00 committed by Kent Overstreet
parent 6df893fb11
commit 6be1b6d9df

View file

@ -152,6 +152,7 @@ long bch2_bucket_alloc_new_fs(struct bch_dev *ca)
for (b = buckets->first_bucket; b < buckets->nbuckets; b++)
if (is_available_bucket(buckets->b[b].mark) &&
(!ca->buckets_nouse || !test_bit(b, ca->buckets_nouse)) &&
!buckets->b[b].mark.owned_by_allocator)
goto success;
b = -1;