Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs-progs: check: detect and repair ram_bytes mismatch for non-compressed data extents
@ 2024-05-02  9:07 Qu Wenruo
  2024-05-02  9:07 ` [PATCH 1/3] btrfs-progs: check/lowmem: detect and repair mismatched ram_bytes Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Qu Wenruo @ 2024-05-02  9:07 UTC (permalink / raw)
  To: linux-btrfs

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


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

end of thread, other threads:[~2024-05-03 13:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02  9:07 [PATCH 0/3] btrfs-progs: check: detect and repair ram_bytes mismatch for non-compressed data extents Qu Wenruo
2024-05-02  9:07 ` [PATCH 1/3] btrfs-progs: check/lowmem: detect and repair mismatched ram_bytes Qu Wenruo
2024-05-02  9:07 ` [PATCH 2/3] btrfs-progs: check/original: detect and repair ram_bytes mismatch Qu Wenruo
2024-05-02  9:07 ` [PATCH 3/3] btrfs-progs: tests/fsck: add test case for ram_bytes detection and repair Qu Wenruo
2024-05-03 13:29 ` [PATCH 0/3] btrfs-progs: check: detect and repair ram_bytes mismatch for non-compressed data extents David Sterba

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