public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 0/2] btrfs-progs: enhance detection on unknown keys in subvolumes
Date: Tue, 16 Dec 2025 19:53:46 +1030	[thread overview]
Message-ID: <cover.1765876829.git.wqu@suse.com> (raw)

[CHANGELOG]
v2:
- Add a new test case

This is inspired by a real world bitflip corruption, where an INODE_REF
is now 8 (an unknown key type), causing btrfs-check to freak out and the
existing INODE_REF/DIR_ITEM/DIR_INDEX repair is not cutting this
particular case for the original mode.

Lowmem mode is better, but for this particular image it's too large and
lowmem is too slow to be practical.

As the first step, detect and report such unknown keys in subvolume
trees as an error.

With a new test case for it.

In the long run we should allow btrfs-check --repair to delete such
unknown keys.

Qu Wenruo (2):
  btrfs-progs: enhance detection on unknown inode keys
  btrfs-progs: add a test case for unknown keys in subvolume trees

 check/main.c                                     |   7 +++++++
 check/mode-lowmem.c                              |   5 +++--
 check/mode-lowmem.h                              |   1 +
 tests/fsck-tests/069-unknown-fs-tree-key/test.sh |  14 ++++++++++++++
 .../unknown_key_empty.img.xz                     | Bin 0 -> 2084 bytes
 5 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100755 tests/fsck-tests/069-unknown-fs-tree-key/test.sh
 create mode 100644 tests/fsck-tests/069-unknown-fs-tree-key/unknown_key_empty.img.xz

--
2.52.0


             reply	other threads:[~2025-12-16  9:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  9:23 Qu Wenruo [this message]
2025-12-16  9:23 ` [PATCH v2 1/2] btrfs-progs: enhance detection on unknown inode keys Qu Wenruo
2025-12-16  9:23 ` [PATCH v2 2/2] btrfs-progs: add a test case for unknown keys in subvolume trees Qu Wenruo
2026-01-24  1:05 ` [PATCH v2 0/2] btrfs-progs: enhance detection on unknown keys in subvolumes David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1765876829.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox