All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs-progs: check: add detection for missing root orphan items
@ 2025-07-25  3:40 Qu Wenruo
  2025-07-25  3:40 ` [PATCH 1/3] btrfs-progs: check/original: detect missing orphan items correctly Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Qu Wenruo @ 2025-07-25  3:40 UTC (permalink / raw)
  To: linux-btrfs

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


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

end of thread, other threads:[~2025-07-26  0:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25  3:40 [PATCH 0/3] btrfs-progs: check: add detection for missing root orphan items Qu Wenruo
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

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.