From: Boris Burkov <boris@bur.io>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 0/3] btrfs-progs: check: add detection for missing root orphan items
Date: Sun, 27 Jul 2025 12:07:14 -0700 [thread overview]
Message-ID: <20250727190613.GA2866105@zen.localdomain> (raw)
In-Reply-To: <cover.1753569082.git.wqu@suse.com>
On Sun, Jul 27, 2025 at 08:02:59AM +0930, Qu Wenruo wrote:
> [CHANGELOG]
> v2:
> - Enhance the original mode to detect any refs mismatch
> Thus even if the root item has 0 refs but we find some unexpected
> backref, then it will also report it as an error.
>
> Thanks Boris for point this out.
>
> 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.
Reviewed-by: Boris Burkov <boris@bur.io>
>
>
> 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 | 39 +++++++++++-------
> check/mode-lowmem.c | 11 +++++
> check/mode-original.h | 3 ++
> .../default.img.xz | Bin 0 -> 13468 bytes
> .../066-missing-root-orphan-item/test.sh | 14 +++++++
> 5 files changed, 51 insertions(+), 16 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.1
>
prev parent reply other threads:[~2025-07-27 19:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-26 22:32 [PATCH v2 0/3] btrfs-progs: check: add detection for missing root orphan items Qu Wenruo
2025-07-26 22:33 ` [PATCH v2 1/3] btrfs-progs: check/original: detect missing orphan items correctly Qu Wenruo
2025-07-26 22:33 ` [PATCH v2 2/3] btrfs-progs: check/lowmem: " Qu Wenruo
2025-07-26 22:33 ` [PATCH v2 3/3] btrfs-progs: fsck-tests: a new test case for missing root orphan item Qu Wenruo
2025-07-27 19:07 ` Boris Burkov [this message]
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=20250727190613.GA2866105@zen.localdomain \
--to=boris@bur.io \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/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