Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs: tree-checker: enhanced fst extent/bitmap checks
@ 2026-05-11  0:56 Qu Wenruo
  2026-05-11  0:56 ` [PATCH 1/3] btrfs: tree-checker: extract the shared key check for free space entries Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Qu Wenruo @ 2026-05-11  0:56 UTC (permalink / raw)
  To: linux-btrfs

The first patch is a small cleanup to share more code and remove
duplications.

The second one is to avoid u64 overflow for the extent/bitmap/space info,
mostly to catch obviously corruptedd size.

The last one is the main part, introducing cross-key checks.

If the previous key is FREE_SPACE_INFO, make sure the current key is
inside the bg range, and matches the type the free space info is using.

If the previous key is FREE_SPACE_EXTENT/BITMAP, make sure the current
key doesn't overlap with the previous one, and type matches the previous
one. This will allow tree-checker to catch most (but not all) bad key
type flipping.

Qu Wenruo (3):
  btrfs: tree-checker: extract the shared key check for free space
    entries
  btrfs: tree-checker: ensure free space tree entries won't overflow
  btrfs: tree-checker: add more cross checks for free space tree

 fs/btrfs/tree-checker.c | 119 +++++++++++++++++++++++++++++++---------
 1 file changed, 93 insertions(+), 26 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-11  0:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11  0:56 [PATCH 0/3] btrfs: tree-checker: enhanced fst extent/bitmap checks Qu Wenruo
2026-05-11  0:56 ` [PATCH 1/3] btrfs: tree-checker: extract the shared key check for free space entries Qu Wenruo
2026-05-11  0:56 ` [PATCH 2/3] btrfs: tree-checker: ensure free space tree entries won't overflow Qu Wenruo
2026-05-11  0:56 ` [PATCH 3/3] btrfs: tree-checker: add more cross checks for free space tree Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox