bcachefs: Be sure to check ptr->dev in copygc pred function
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 18 Aug 2021 20:19:28 +0000 (16:19 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:10 +0000 (17:09 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/movinggc.c

index b805371..651381a 100644 (file)
@@ -85,6 +85,7 @@ static enum data_cmd copygc_pred(struct bch_fs *c, void *arg,
                BUG_ON(i != j);
 #endif
                if (i >= 0 &&
+                   p.ptr.dev == h->data[i].dev &&
                    p.ptr.offset < h->data[i].offset + ca->mi.bucket_size &&
                    p.ptr.gen == h->data[i].gen) {
                        /*