Skip to content

btrfs-progs: Bad extent item generation related bug fixes

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5btrfs-progs: check: Initialize extent_record::generation membercheck/main.c+1 -00 replies
2/5btrfs-progs: check: Populate extent generation correctly for data extentscheck/main.c+17 -70 replies
3/5btrfs-progs: check/lowmem: Detect invalid EXTENT_ITEM and EXTENT_DATA generationcheck/mode-lowmem.c+19 -00 replies
4/5btrfs-progs: check/original: Detect invalid extent generationcheck/main.c+11 -00 replies
5/5btrfs-progs: fsck-tests: Make sure btrfs check can detect bad extent item generationtests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz tests/fsck-tests/044-invalid-extent-item-generation/test.sh+19 -00 replies

Reviews trailers per patch

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

PatchSu Yue
SeriesR-b
1/5
2/5
3/5
4/5
5/5

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/5] btrfs-progs: Bad extent item generation related bug fixes

There is an issue reported in github, where an fs get corrupted extent tree initialy, then I recommended --init-extent-tree.

Although --init-extent-tree indeed fixed the original problem, it caused new problems, quite a lot of EXTENT_ITEMs now get bad generation number, which failed to mount with v5.4.

The problem turns out to be a bug in backref repair code, which doesn't initialize extent_record::generation, causing garbage in EXTENT_ITEMs.

This patch will:
- Fix the problem
Patch 1

- Enhance EXTENT_ITEM generation repair
Patch 2

- Make btrfs check able to detect such bad generation Patch 3~4

- Add new test case for above ability
Patch 5

Qu Wenruo (5):
btrfs-progs: check: Initialize extent_record::generation member
btrfs-progs: check: Populate extent generation correctly for data
extents
btrfs-progs: check/lowmem: Detect invalid EXTENT_ITEM and EXTENT_DATA
generation
btrfs-progs: check/original: Detect invalid extent generation
btrfs-progs: fsck-tests: Make sure btrfs check can detect bad extent
item generation

 check/main.c                                  |  36 ++++++++++++++----
 check/mode-lowmem.c                           |  19 +++++++++
 .../bad_extent_item_gen.img.xz                | Bin 0 -> 1916 bytes
 .../test.sh                                   |  19 +++++++++
 4 files changed, 67 insertions(+), 7 deletions(-)
 create mode 100644 tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz
 create mode 100755 tests/fsck-tests/044-invalid-extent-item-generation/test.sh
Signature · 1 line
2.24.1