It's possible when shutting down to for a stripe head to have a new
stripe that doesn't yet have any blocks allocated - we just need to free
it.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
void bch2_fs_ec_exit(struct bch_fs *c)
{
struct ec_stripe_head *h;
+ unsigned i;
while (1) {
mutex_lock(&c->ec_stripe_head_lock);
if (!h)
break;
- BUG_ON(h->s);
+ if (h->s) {
+ for (i = 0; i < h->s->new_stripe.key.v.nr_blocks; i++)
+ BUG_ON(h->s->blocks[i]);
+
+ kfree(h->s);
+ }
kfree(h);
}