bcachefs: Improve path for when btree_gc needs another pass
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 2 Jan 2022 04:16:15 +0000 (23:16 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:22 +0000 (17:09 -0400)
commit8f11548edbccc316939dddf7a52d0aa8151a5ba6
tree50df452d1c2096a12c81b333ffc901b2e2e33d34
parent4e08446db05427ad0972eba58d6447b21c1ca7e1
bcachefs: Improve path for when btree_gc needs another pass

btree_gc sometimes needs another pass when it corrects bucket generation
numbers or data types - when it finds multiple pointers of different
data types to the same bucket, it may want to keep the second one it
found.

When this happens, we now clear out bucket sector counts _without_
resetting the bucket generation/data types that we already found,
instead of resetting them to what we have in the alloc btree.

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