From: Kent Overstreet Date: Tue, 1 Dec 2020 16:42:23 +0000 (-0500) Subject: bcachefs: Fix for fsck spuriously finding duplicate extents X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=34c1cd6a59bf1a72bb1b672df35f9d819c81bfde;p=linux.git bcachefs: Fix for fsck spuriously finding duplicate extents Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index 09ce6c29b88cf..7449819d8eac5 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -485,7 +485,11 @@ static int check_extents(struct bch_fs *c) BTREE_ITER_INTENT); retry: for_each_btree_key_continue(iter, 0, k, ret) { - if (bkey_cmp(prev.k->k.p, bkey_start_pos(k.k)) > 0) { + /* + * due to retry errors we might see the same extent twice: + */ + if (bkey_cmp(prev.k->k.p, k.k->p) && + bkey_cmp(prev.k->k.p, bkey_start_pos(k.k)) > 0) { char buf1[200]; char buf2[200];