From: Kent Overstreet Date: Mon, 20 Dec 2021 17:53:06 +0000 (-0500) Subject: bcachefs: Make sure bch2_bucket_alloc_new_fs() obeys buckets_nouse X-Git-Tag: v6.7-rc1~201^2~1247 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6be1b6d9df9dfe7065220b64b32de339b1120f1b;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Make sure bch2_bucket_alloc_new_fs() obeys buckets_nouse This fixes the filesystem migrate tool. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index e3fe4d7bbe214..646d556a5c246 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -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;