bcachefs: Fix btree_and_journal_iter
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 7 Jun 2022 01:59:34 +0000 (21:59 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:33 +0000 (17:09 -0400)
commit576179021c90bea808ac12c491bd9b239ca80c2e
tree9e43517d7619b1ef51573f45a8fb813b80bdd2c3
parentf2aa02657561b0e6d96089eb8ee44e4154f4acad
bcachefs: Fix btree_and_journal_iter

We had a bug where btree_and_journal_iter would return the same key
twice - after deleting it (perhaps because it was present in both the
btree and the journal?)

This reworks btree_and_journal_iter to track the current position, much
like btree_paths, which makes the logic considerably simpler and more
robust.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/recovery.c
fs/bcachefs/recovery.h