Skip to content

btrfs: tree-checker: enhanced fst extent/bitmap checks

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: tree-checker: extract the shared key check for free space entriesfs/btrfs/tree-checker.c+23 -230 replies
2/3btrfs: tree-checker: ensure free space tree entries won't overflowfs/btrfs/tree-checker.c+14 -00 replies
3/3btrfs: tree-checker: add more cross checks for free space treefs/btrfs/tree-checker.c+60 -70 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid Sterba
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs: tree-checker: enhanced fst extent/bitmap checks

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(-)
Signature · 1 line
2.54.0