Commit ec35b304 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix lost transaction restart error

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a5860368
...@@ -1356,16 +1356,18 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *trans, ...@@ -1356,16 +1356,18 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *trans,
/* Don't retry from all devices if we're out of open buckets: */ /* Don't retry from all devices if we're out of open buckets: */
if (bch2_err_matches(ret, BCH_ERR_open_buckets_empty)) { if (bch2_err_matches(ret, BCH_ERR_open_buckets_empty)) {
int ret = open_bucket_add_buckets(trans, &ptrs, wp, devs_have, int ret2 = open_bucket_add_buckets(trans, &ptrs, wp, devs_have,
target, erasure_code, target, erasure_code,
nr_replicas, &nr_effective, nr_replicas, &nr_effective,
&have_cache, watermark, &have_cache, watermark,
flags, cl); flags, cl);
if (!ret || if (!ret2 ||
bch2_err_matches(ret, BCH_ERR_transaction_restart) || bch2_err_matches(ret2, BCH_ERR_transaction_restart) ||
bch2_err_matches(ret, BCH_ERR_open_buckets_empty)) bch2_err_matches(ret2, BCH_ERR_open_buckets_empty)) {
ret = ret2;
goto alloc_done; goto alloc_done;
} }
}
/* /*
* Only try to allocate cache (durability = 0 devices) from the * Only try to allocate cache (durability = 0 devices) from the
......
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