Commit 47ab0c5f authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix bch2_check_alloc_key()

bch2_check_alloc_key() was failing to check buckets that didn't have
alloc keys yet (because they'd never been used) - they still need to be
added to the freespace btree.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent e34da43e
......@@ -618,7 +618,9 @@ static int bch2_check_alloc_key(struct btree_trans *trans,
struct printbuf buf = PRINTBUF;
int ret;
alloc_k = bch2_btree_iter_peek(alloc_iter);
alloc_k = bch2_dev_bucket_exists(c, alloc_iter->pos)
? bch2_btree_iter_peek_slot(alloc_iter)
: bch2_btree_iter_peek(alloc_iter);
if (!alloc_k.k)
return 1;
......
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