Commit aebe7a67 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix stripe create error path

If we errored out on a new stripe before fully allocating it, we
shouldn't be zeroing out unwritten data.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ae1f5623
...@@ -1078,6 +1078,7 @@ static void ec_stripe_create(struct ec_stripe_new *s) ...@@ -1078,6 +1078,7 @@ static void ec_stripe_create(struct ec_stripe_new *s)
closure_sync(&s->iodone); closure_sync(&s->iodone);
if (!s->err) {
for (i = 0; i < nr_data; i++) for (i = 0; i < nr_data; i++)
if (s->blocks[i]) { if (s->blocks[i]) {
ob = c->open_buckets + s->blocks[i]; ob = c->open_buckets + s->blocks[i];
...@@ -1085,6 +1086,7 @@ static void ec_stripe_create(struct ec_stripe_new *s) ...@@ -1085,6 +1086,7 @@ static void ec_stripe_create(struct ec_stripe_new *s)
if (ob->sectors_free) if (ob->sectors_free)
zero_out_rest_of_ec_bucket(c, s, i, ob); zero_out_rest_of_ec_bucket(c, s, i, ob);
} }
}
if (s->err) { if (s->err) {
if (!bch2_err_matches(s->err, EROFS)) if (!bch2_err_matches(s->err, EROFS))
......
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