Commit e3877382 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix erasure coding shutdown path

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 64784ade
...@@ -1764,6 +1764,7 @@ void bch2_new_stripes_to_text(struct printbuf *out, struct bch_fs *c) ...@@ -1764,6 +1764,7 @@ void bch2_new_stripes_to_text(struct printbuf *out, struct bch_fs *c)
void bch2_fs_ec_exit(struct bch_fs *c) void bch2_fs_ec_exit(struct bch_fs *c)
{ {
struct ec_stripe_head *h; struct ec_stripe_head *h;
unsigned i;
while (1) { while (1) {
mutex_lock(&c->ec_stripe_head_lock); mutex_lock(&c->ec_stripe_head_lock);
...@@ -1775,7 +1776,12 @@ void bch2_fs_ec_exit(struct bch_fs *c) ...@@ -1775,7 +1776,12 @@ void bch2_fs_ec_exit(struct bch_fs *c)
if (!h) if (!h)
break; 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); kfree(h);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment