mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
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: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ae1f56238d
commit
aebe7a679c
|
|
@ -1078,13 +1078,15 @@ static void ec_stripe_create(struct ec_stripe_new *s)
|
|||
|
||||
closure_sync(&s->iodone);
|
||||
|
||||
for (i = 0; i < nr_data; i++)
|
||||
if (s->blocks[i]) {
|
||||
ob = c->open_buckets + s->blocks[i];
|
||||
if (!s->err) {
|
||||
for (i = 0; i < nr_data; i++)
|
||||
if (s->blocks[i]) {
|
||||
ob = c->open_buckets + s->blocks[i];
|
||||
|
||||
if (ob->sectors_free)
|
||||
zero_out_rest_of_ec_bucket(c, s, i, ob);
|
||||
}
|
||||
if (ob->sectors_free)
|
||||
zero_out_rest_of_ec_bucket(c, s, i, ob);
|
||||
}
|
||||
}
|
||||
|
||||
if (s->err) {
|
||||
if (!bch2_err_matches(s->err, EROFS))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user