Skip to content

btrfs-progs: check: properly fix missing INODE_REF cases

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/original: add dedicated missing INODE_REF repaircheck/main.c+51 -00 replies
2/3btrfs-progs: check/lowmem: fix INODE_REF repaircheck/mode-lowmem.c+11 -00 replies
3/3btrfs-progs: fsck-tests: add a test case for repairing missing INODE_REFtests/fsck-tests/070-missing-inode-ref/.lowmem_repairable tests/fsck-tests/070-missing-inode-ref/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: properly fix missing INODE_REF cases

This is inspired by a recent corruption report that an INODE_REF key hits a bitflip and becomes UNKNOWN.8 key.

That cause missing INODE_REF, and unfortunately neither original nor lowmem mode can properly handle it.

For the original mode it just completely lacks the handling for such case, thus fallback to delete the good DIR_INDEX, making things worse.

For the lowmem mode, although it is trying to keep the good DIR_INDEX/DIR_ITEM, it doesn't handle index number search, thus using the default (-1) as index, causing incorrect new link to be added.

Fix both modes, and add a new test case for it.

Qu Wenruo (3):
btrfs-progs: check/original: add dedicated missing INODE_REF repair
btrfs-progs: check/lowmem: fix INODE_REF repair
btrfs-progs: fsck-tests: add a test case for repairing missing
INODE_REF

 check/main.c                                  |  51 ++++++++++++++++++
 check/mode-lowmem.c                           |  11 ++++
 .../070-missing-inode-ref/.lowmem_repairable  |   0
 .../070-missing-inode-ref/default.img.xz      | Bin 0 -> 2092 bytes
 4 files changed, 62 insertions(+)
 create mode 100644 tests/fsck-tests/070-missing-inode-ref/.lowmem_repairable
 create mode 100644 tests/fsck-tests/070-missing-inode-ref/default.img.xz

--
2.52.0