From: Kent Overstreet Date: Sat, 11 Mar 2023 20:52:37 +0000 (-0500) Subject: bcachefs: Fix next_bucket() X-Git-Tag: io_uring-6.7-2023-11-10~119^2~426 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=46e14854fca4a262a823079c1958a204f983fa4e;p=linux-block.git bcachefs: Fix next_bucket() This fixes an infinite loop in bch2_get_key_or_real_bucket_hole(). Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index ce0ea4886288..e5abe6406afe 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -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;