Skip to content

btrfs-progs: check: detect and repair ram_bytes mismatch for non-compressed data extents

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-progs: check/lowmem: detect and repair mismatched ram_bytescheck/mode-lowmem.c check/mode-lowmem.h+70 -00 replies
2/3btrfs-progs: check/original: detect and repair ram_bytes mismatchcheck/main.c check/mode-original.h+130 -40 replies
3/3btrfs-progs: tests/fsck: add test case for ram_bytes detection and repairtests/fsck-tests/062-noncompressed-ram-bytes-mismatch/default.img.xz+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs-progs: check: detect and repair ram_bytes mismatch for non-compressed data extents

There are at least one kernel bug that makes on-disk btrfs_file_extent_item::ram_bytes incorrect for non-compressed non-hole data extents.

Thankfully kernel just doesn't care ram_bytes for non-compressed extents at all, so it doesn't lead to any data corruption or whatever, and this is really just a minor problem.

But for the sake of consistency and to follow the on-disk format, we should still detect and repair such problems.

This patchset would implement detection and repair for both lowmem and original mode, and a new hand crafted test case for it.

The reason why the test case is still handle crafted is, we do not have the btrfs-corrupt-block support for corrupting ram_bytes to a specific value yet.

I'd prefer to do the binary image migration to script in a dedicated patchset in the future.

Qu Wenruo (3):
btrfs-progs: check/lowmem: detect and repair mismatched ram_bytes
btrfs-progs: check/original: detect and repair ram_bytes mismatch
btrfs-progs: tests/fsck: add test case for ram_bytes detection and
repair

 check/main.c                                  | 126 +++++++++++++++++-
 check/mode-lowmem.c                           |  69 ++++++++++
 check/mode-lowmem.h                           |   1 +
 check/mode-original.h                         |   8 ++
 .../default.img.xz                            | Bin 0 -> 2076 bytes
 5 files changed, 200 insertions(+), 4 deletions(-)
 create mode 100644 tests/fsck-tests/062-noncompressed-ram-bytes-mismatch/default.img.xz

--
2.45.0