]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
bcachefs: ec should not allocate from ro devs
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 7 Aug 2024 03:30:48 +0000 (23:30 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 7 Aug 2024 12:31:10 +0000 (08:31 -0400)
This fixes a device removal deadlock when using erasure coding.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/ec.c

index 8d0cca2f14ed2e67651a80487e35e2a14c7e6262..84f1cbf6497f9f670b443bb94c025dc26bba5dd4 100644 (file)
@@ -1809,6 +1809,9 @@ static int new_stripe_alloc_buckets(struct btree_trans *trans, struct ec_stripe_
        BUG_ON(v->nr_blocks     != h->s->nr_data + h->s->nr_parity);
        BUG_ON(v->nr_redundant  != h->s->nr_parity);
 
+       /* * We bypass the sector allocator which normally does this: */
+       bitmap_and(devs.d, devs.d, c->rw_devs[BCH_DATA_user].d, BCH_SB_MEMBERS_MAX);
+
        for_each_set_bit(i, h->s->blocks_gotten, v->nr_blocks) {
                __clear_bit(v->ptrs[i].dev, devs.d);
                if (i < h->s->nr_data)