Commit dc6274bc authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix nocow write path closure bug

With regular waitlists, we need to ensure we always call finish_wait().
With closures, the equivalent is that we need to call closure_sync()
before returning with a stack-allocated closure.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ac77810c
...@@ -453,13 +453,13 @@ int bch2_extent_fallocate(struct btree_trans *trans, ...@@ -453,13 +453,13 @@ int bch2_extent_fallocate(struct btree_trans *trans,
opts.data_replicas, opts.data_replicas,
opts.data_replicas, opts.data_replicas,
RESERVE_none, 0, &cl, &wp); RESERVE_none, 0, &cl, &wp);
if (bch2_err_matches(ret, BCH_ERR_operation_blocked)) { if (ret) {
bch2_trans_unlock(trans); bch2_trans_unlock(trans);
closure_sync(&cl); closure_sync(&cl);
goto retry; if (bch2_err_matches(ret, BCH_ERR_operation_blocked))
} goto retry;
if (ret)
return ret; return ret;
}
sectors = min(sectors, wp->sectors_free); sectors = min(sectors, wp->sectors_free);
sectors_allocated = sectors; sectors_allocated = sectors;
......
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