summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-04-21 00:34:58 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-05-30 18:17:23 -0400
commit57b1a9878a66e0496906302cc8cc189d4a9aa727 (patch)
treecddc2bbddeb21b76238861a7b2ba9abee37ee599 /fs/bcachefs/recovery.c
parent188ddfc328b761497b9c6c22b3d59d6f31d03374 (diff)
bcachefs: Fix journal_iters_fix()
journal_iters_fix() was incorrectly rewinding iterators past keys they had already returned, leading to those keys being double counted in the bch2_gc() path - oops. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index b5c46d45280c..ff483ff303da 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -147,7 +147,7 @@ static void journal_iters_fix(struct bch_fs *c)
/*
* If an iterator points one after the key we just inserted,
- * and the key we just inserted compares >= the iterator's position,
+ * and the key we just inserted compares > the iterator's position,
* decrement the iterator so it points at the key we just inserted:
*/
list_for_each_entry(iter, &c->journal_iters, journal.list)
@@ -155,7 +155,7 @@ static void journal_iters_fix(struct bch_fs *c)
iter->last &&
iter->b->c.btree_id == n->btree_id &&
iter->b->c.level == n->level &&
- bpos_cmp(n->k->k.p, iter->unpacked.p) >= 0)
+ bpos_cmp(n->k->k.p, iter->unpacked.p) > 0)
iter->journal.idx = keys->gap - 1;
}