This patchset can be fetched from my repo: https://github.com/Damenly/btrfs-progs/tree/file_extent_fixes which is based on kdave/devel whose HEAD is: commit 4f20c27ab33aab3efffe13cdae1b8837c821d0d7 (kdave/devel) Author: Nikolay Borisov <nbori...@suse.com> Date: Fri Jun 15 07:13:50 2018 +0000
btrfs-progs: tests: test for FST corruption detection/repair This set fixes bugs of checking unaligned disk_bytenr extent_data and orphan extent. Lowmem part patches can be used in common, so I put this two fixes together. For unaligned disk_bytenr extent_data, now original and lowmem check both delete the corrupted part and punch a hole. For orphan extent, lowmem mode has no change here. Original mode discards function of detect and repair orphan extents according extent items. Because as corruptions the community reported, extent tree is more problematic than fs trees. patch[1-2] fix minor bugs in lowmem repair. patch[3] fixes false alert about repaired extent item in lowmem mode. patch[4] fixes annoying alerts about gap in file extent in lowmem mode. patch[5,6,7] enable check and repair unaligned disk_bytenr file extent in lowmem mode. patch[8,9] revert support for orphan extent in original mode. patch[10] fixes bug about finding right backrefs in original mode. patch[11] adds support to detect and delete unaligned file extents in original. patch[12] adds a test image which lacks of a file extent. patch[13] enables lowmem repair of test case fsck-tests/001 which has unaligned disk_bytenr file extent. Lu Fengqi (2): btrfs-progs: lowmem: fix false alert about the existence of gaps in the check_file_extent btrfs-progs: tests: add case for inode lose one file extent Su Yanjun (4): btrfs-progs: Revert "btrfs-progs: Add repair and report function for orphan file extent." btrfs-progs: Revert "btrfs-progs: Record orphan data extent ref to corresponding root." btrfs-progs: check: fix bug in find_possible_backrefs btrfs-progs: check: Delete file extent item with unaligned extent backref Su Yue (7): btrfs-progs: lowmem: add argument path to punch_extent_hole() btrfs-progs: lowmem: move nbytes check before isize check btrfs-progs: lowmem: fix false alert if extent item has been repaired btrfs-progs: lowmem: check unaligned disk_bytenr for extent_data btrfs-progs: lowmem: rename delete_extent_tree_item() to delete_item() btrfs-progs: lowmem: delete unaligned bytes extent data under repair btrfs-progs: fsck-test: enable lowmem repair for case 001 check/main.c | 581 +++++++++++------- check/mode-lowmem.c | 272 ++++---- check/mode-original.h | 30 +- ctree.h | 10 +- disk-io.c | 2 +- .../.lowmem_repairable | 0 .../.lowmem_repairable | 0 .../default_case.img | Bin 0 -> 3072 bytes 8 files changed, 538 insertions(+), 357 deletions(-) create mode 100644 tests/fsck-tests/001-bad-file-extent-bytenr/.lowmem_repairable create mode 100644 tests/fsck-tests/038-missing-one-file-extent/.lowmem_repairable create mode 100644 tests/fsck-tests/038-missing-one-file-extent/default_case.img -- 2.19.1