Skip to content

btrfs-progs: check: Add repair support for mismatch dir item hash

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs-progs: lowmem check: Add ability to repair dir item with mismatch hashcheck/mode-common.c check/mode-common.h check/mode-lowmem.c +3 more+101 -110 replies
2/4btrfs-progs: original check: Use mismatch_dir_hash_record to record bad dir itemscheck/main.c check/mode-original.h+86 -40 replies
3/4btrfs-progs: original check: Add ability to repair dir item with invalid hashcheck/main.c+44 -10 replies
4/4btrfs-progs: fsck-tests: Make 026-bad-dir-item-name test case to verify if btrfs-check can also repair ittests/fsck-tests/026-bad-dir-item-name/description.txt tests/fsck-tests/026-bad-dir-item-name/test.sh+41 -130 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/4] btrfs-progs: check: Add repair support for mismatch dir item hash

This patchset can be fetched from github:
https://github.com/adam900710/btrfs-progs/tree/repair_bad_dir_item_hash

This is still based on the latest stable v4.17.1 branch (which is already a little old now)

We have report from suse bugzilla where user report latest kernel refuse to mount the fs.

The problem turns out to be that some old kernel (around Jan 2017) has a bug that could leads to corrupted dir item with mismatch hash.

This patchset will allow btrfs check --repair to repair such problem.

Qu Wenruo (4):
btrfs-progs: lowmem check: Add ability to repair dir item with
mismatch hash
btrfs-progs: original check: Use mismatch_dir_hash_record to record
bad dir items
btrfs-progs: original check: Add ability to repair dir item with
invalid hash
btrfs-progs: fsck-tests: Make 026-bad-dir-item-name test case to
verify if btrfs-check can also repair it

 check/main.c                                  | 121 +++++++++++++++++-
 check/mode-common.c                           |  51 ++++++++
 check/mode-common.h                           |   5 +-
 check/mode-lowmem.c                           |  46 ++++++-
 check/mode-lowmem.h                           |   1 +
 check/mode-original.h                         |  14 ++
 ctree.h                                       |   3 +
 dir-item.c                                    |   6 +-
 .../026-bad-dir-item-name/description.txt     |  41 ++++++
 .../fsck-tests/026-bad-dir-item-name/test.sh  |  13 --
 10 files changed, 272 insertions(+), 29 deletions(-)
 create mode 100644 tests/fsck-tests/026-bad-dir-item-name/description.txt
 delete mode 100755 tests/fsck-tests/026-bad-dir-item-name/test.sh
Signature · 1 line
2.19.1