From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/3] btrfs-progs: check: add detection for missing root orphan items
Date: Fri, 25 Jul 2025 13:10:40 +0930 [thread overview]
Message-ID: <cover.1753414100.git.wqu@suse.com> (raw)
There is an internal bug report that some half-dropped subvolume makes
balance to fail.
It turns out that, the involved subvolume doesn't have an orphan item,
this means the half-dropped subvolume is never going to be cleaned up.
Then at balance time, a reloc tree is created for that half-dropped
subvolume, and since balance doesn't expect to get a half-dropped
subvolume, it doesn't check the drop_process_key and increased ref on
already dropped nodes.
The problem for progs is that, neither original mode nor lowmem detects
this kind of problem.
Original mode has a bad logic which prevents us from calling the proper
orphan item check.
Lowmem mode doesn't even take orphan item into consideration.
This series will add the detection part for btrfs-check, for both
original and lowmem mode, with a hand crafted image for test.
Qu Wenruo (3):
btrfs-progs: check/original: detect missing orphan items correctly
btrfs-progs: check/lowmem: detect missing orphan items correctly
btrfs-progs: fsck-tests: a new test case for missing root orphan item
check/main.c | 3 +--
check/mode-lowmem.c | 11 +++++++++++
.../066-missing-root-orphan-item/default.img.xz | Bin 0 -> 13468 bytes
.../066-missing-root-orphan-item/test.sh | 14 ++++++++++++++
4 files changed, 26 insertions(+), 2 deletions(-)
create mode 100644 tests/fsck-tests/066-missing-root-orphan-item/default.img.xz
create mode 100755 tests/fsck-tests/066-missing-root-orphan-item/test.sh
--
2.50.0
next reply other threads:[~2025-07-25 3:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 3:40 Qu Wenruo [this message]
2025-07-25 3:40 ` [PATCH 1/3] btrfs-progs: check/original: detect missing orphan items correctly Qu Wenruo
2025-07-25 18:09 ` Boris Burkov
2025-07-26 0:43 ` Qu Wenruo
2025-07-25 3:40 ` [PATCH 2/3] btrfs-progs: check/lowmem: " Qu Wenruo
2025-07-25 3:40 ` [PATCH 3/3] btrfs-progs: fsck-tests: a new test case for missing root orphan item Qu Wenruo
2025-07-25 18:10 ` [PATCH 0/3] btrfs-progs: check: add detection for missing root orphan items Boris Burkov
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.1753414100.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.