bcachefs: Fix bch2_check_extents_to_backpointers()
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 14 Mar 2023 16:54:21 +0000 (12:54 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:57 +0000 (17:09 -0400)
commit872c0311675bdb73b29ee74c7f27afc82d4918e9
tree400b87f972f1ded45707837a9cf1be91f6dd56a7
parentc639c29ce6882f4f77a81d778ef4741d5a5979d9
bcachefs: Fix bch2_check_extents_to_backpointers()

In rare cases, bch2_check_extents_to_backpointers() would incorrectly
flag an extent has having a missing backpointer when we just needed to
flush the btree write buffer - we weren't tracking the last flushed
position correctly.

This adds a level field to the last_flushed pos, fixing a bug where we'd
sometimes fail on a new root node.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/backpointers.c