Skip to content

Commit b1e5622

Browse files
author
Kent Overstreet
committed
bcachefs: Fix kasan splat in new_stripe_alloc_buckets()
Update for BCH_SB_MEMBER_INVALID. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 9f25dbe commit b1e5622

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fs/bcachefs/ec.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,15 @@ static int new_stripe_alloc_buckets(struct btree_trans *trans, struct ec_stripe_
18851885
bitmap_and(devs.d, devs.d, c->rw_devs[BCH_DATA_user].d, BCH_SB_MEMBERS_MAX);
18861886

18871887
for_each_set_bit(i, h->s->blocks_gotten, v->nr_blocks) {
1888-
__clear_bit(v->ptrs[i].dev, devs.d);
1888+
/*
1889+
* Note: we don't yet repair invalid blocks (failed/removed
1890+
* devices) when reusing stripes - we still need a codepath to
1891+
* walk backpointers and update all extents that point to that
1892+
* block when updating the stripe
1893+
*/
1894+
if (v->ptrs[i].dev != BCH_SB_MEMBER_INVALID)
1895+
__clear_bit(v->ptrs[i].dev, devs.d);
1896+
18891897
if (i < h->s->nr_data)
18901898
nr_have_data++;
18911899
else

0 commit comments

Comments
 (0)