Commit db36c147 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix bch2_bucket_alloc_early()

We were incorrectly retrying after a transaction restart.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 9fea089a
...@@ -421,12 +421,15 @@ bch2_bucket_alloc_early(struct btree_trans *trans, ...@@ -421,12 +421,15 @@ bch2_bucket_alloc_early(struct btree_trans *trans,
ca->alloc_cursor = alloc_cursor; ca->alloc_cursor = alloc_cursor;
if (!ob && ret)
ob = ERR_PTR(ret);
if (!ob && alloc_cursor > alloc_start) { if (!ob && alloc_cursor > alloc_start) {
alloc_cursor = alloc_start; alloc_cursor = alloc_start;
goto again; goto again;
} }
return ob ?: ERR_PTR(ret ?: -BCH_ERR_no_buckets_found); return ob;
} }
static struct open_bucket *bch2_bucket_alloc_freelist(struct btree_trans *trans, static struct open_bucket *bch2_bucket_alloc_freelist(struct btree_trans *trans,
......
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