btrfs-progs: check: add detection for missing root orphan items
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 1 replyIn review
- v13 patches 3 repliesSuperseded
Changes in v2 from the cover letter
- 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.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs-progs: check/original: detect missing orphan items correctlycheck/ check/ | +26 | 0 replies | |
| 2/3 | btrfs-progs: check/lowmem: detect missing orphan items correctlycheck/ | +11 | 0 replies | |
| 3/3 | btrfs-progs: fsck-tests: a new test case for missing root orphan itemtests/ tests/ | +14 | 0 replies |
Reviews trailers per patch
2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Boris Burkov |
|---|---|
| Series | R-b |
| 1/3 | |
| 2/3 | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/3] btrfs-progs: check: add detection for missing root orphan items
[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.
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