public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs-progs: check: properly fix missing INODE_REF cases
@ 2025-12-17  8:08 Qu Wenruo
  2025-12-17  8:08 ` [PATCH 1/3] btrfs-progs: check/original: add dedicated missing INODE_REF repair Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Qu Wenruo @ 2025-12-17  8:08 UTC (permalink / raw)
  To: linux-btrfs

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


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

end of thread, other threads:[~2026-01-24  1:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17  8:08 [PATCH 0/3] btrfs-progs: check: properly fix missing INODE_REF cases Qu Wenruo
2025-12-17  8:08 ` [PATCH 1/3] btrfs-progs: check/original: add dedicated missing INODE_REF repair Qu Wenruo
2025-12-17  8:08 ` [PATCH 2/3] btrfs-progs: check/lowmem: fix " Qu Wenruo
2025-12-17  8:08 ` [PATCH 3/3] btrfs-progs: fsck-tests: add a test case for repairing missing INODE_REF Qu Wenruo
2026-01-24  1:00 ` [PATCH 0/3] btrfs-progs: check: properly fix missing INODE_REF cases David Sterba

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