bcachefs: Fix stripe reuse path
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 5 Mar 2023 07:52:40 +0000 (02:52 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:55 +0000 (17:09 -0400)
commit5be6a274ff7a7cd9640555db63d60127c6434e1a
tree11bf3a31b820a99ae2d161662b3ee680119a146d
parentac2ccddc2689d5889fd1520383738b60dbafc1d0
bcachefs: Fix stripe reuse path

It's possible that we reuse a stripe that doesn't have quite the same
configuration as the stripe_head we're allocating from. In that case, we
have to make sure that the new stripe uses the settings from the stripe
we resue, not the stripe head, and make sure the buffer is allocated
correctly.

This fixes the ec_mixed_tiers test.

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