]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: check_extents_to_backpointers() now only checks buckets with mismatches
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 15 Nov 2024 21:31:54 +0000 (16:31 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 29 Dec 2024 18:30:39 +0000 (13:30 -0500)
commitc738866e47ef2e4d543698f0ab370ffe2b7e0d59
tree2f6f532006d3b976af6dd2d75a274013cb467be0
parent056cae1c00b9773aa69791f4703262f690c28cdb
bcachefs: check_extents_to_backpointers() now only checks buckets with mismatches

Instead of walking every extent and every backpointer it points to,
first sum up backpointers in each bucket and check for mismatches, and
only look for missing backpointers if mismatches were detected, and only
check extents in those buckets.

This is a major fsck scalability improvement, since the two backpointers
passes (backpointers -> extents and extents -> backpointers) are the
most expensive fsck passes by far.

Additionally, to speed up the upgrade for backpointer bucket gens, or in
situations when we have to rebuild alloc info, add a special case for
when no backpointers are found in a bucket - don't check each individual
backpointer (in particular, avoiding the write buffer flushes), just
recreate them.

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