summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_background.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-11 23:52:37 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:57 +0300
commit46e14854fca4a262a823079c1958a204f983fa4e (patch)
tree85235d05817d5c0326d60119606de1706045ea4d /fs/bcachefs/alloc_background.c
parentfba053d2aaca8f9a4486e865452d80245a8cc215 (diff)
downloadlinux-46e14854fca4a262a823079c1958a204f983fa4e.tar.xz
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>
Diffstat (limited to 'fs/bcachefs/alloc_background.c')
-rw-r--r--fs/bcachefs/alloc_background.c2
1 files changed, 1 insertions, 1 deletions
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;