Skip to content

Commit 2caca9f

Browse files
author
Kent Overstreet
committed
bcachefs: ec should not allocate from ro devs
This fixes a device removal deadlock when using erasure coding. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent c1e4446 commit 2caca9f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/bcachefs/ec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,9 @@ static int new_stripe_alloc_buckets(struct btree_trans *trans, struct ec_stripe_
18091809
BUG_ON(v->nr_blocks != h->s->nr_data + h->s->nr_parity);
18101810
BUG_ON(v->nr_redundant != h->s->nr_parity);
18111811

1812+
/* * We bypass the sector allocator which normally does this: */
1813+
bitmap_and(devs.d, devs.d, c->rw_devs[BCH_DATA_user].d, BCH_SB_MEMBERS_MAX);
1814+
18121815
for_each_set_bit(i, h->s->blocks_gotten, v->nr_blocks) {
18131816
__clear_bit(v->ptrs[i].dev, devs.d);
18141817
if (i < h->s->nr_data)

0 commit comments

Comments
 (0)