From 28624ba424fd73154438fd6552e6b555b3376a65 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 18 Aug 2021 16:19:28 -0400 Subject: [PATCH] bcachefs: Be sure to check ptr->dev in copygc pred function Signed-off-by: Kent Overstreet --- fs/bcachefs/movinggc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index b805371fe99f8..651381a5ccc5f 100644 --- a/fs/bcachefs/movinggc.c +++ b/fs/bcachefs/movinggc.c @@ -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) { /* -- 2.30.2