bcachefs: Fix next_bucket()

This fixes an infinite loop in bch2_get_key_or_real_bucket_hole().

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-03-11 15:52:37 -05:00
parent fba053d2aa
commit 46e14854fc

View file

@ -1006,7 +1006,7 @@ static bool next_bucket(struct bch_fs *c, struct bpos *bucket)
iter = bucket->inode;
ca = __bch2_next_dev(c, &iter, NULL);
if (ca)
bucket->offset = ca->mi.first_bucket;
*bucket = POS(ca->dev_idx, ca->mi.first_bucket);
rcu_read_unlock();
return ca != NULL;