bcachefs: Fix bch2_bucket_alloc_early()

We were incorrectly retrying after a transaction restart.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-01-23 20:28:59 -05:00
parent 9fea089a95
commit db36c1477d

View File

@ -421,12 +421,15 @@ again:
ca->alloc_cursor = alloc_cursor;
if (!ob && ret)
ob = ERR_PTR(ret);
if (!ob && alloc_cursor > alloc_start) {
alloc_cursor = alloc_start;
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,