btrfs-progs: detect and fix orphan roots without orphan items
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs-progs: check/lowmem: add the ability to detect and repair orphan subvolume trees which doesn't have orphan itemcheck/ check/ check/ | +82 | 2 replies | |
| 2/3 | btrfs-progs: check/original: detect and repair orphan subvolume without orphan itemcheck/ | +11 | 0 replies | |
| 3/3 | btrfs-progs: fsck-tests: add test image for orphan roots without an orphan itemtests/ tests/ | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] btrfs-progs: detect and fix orphan roots without orphan items
There is bug report from Zhenyu Wu <[email protected]>, where even there is only one subvolume, his filesystem still consumes way more space than expected.
The problem is, there are 58 snapshots, but all of them have no ROOT_REF/ROOT_BACKREF, and all their root refs is 0.
But strangely there is no orphan items for them.
This means, btrfs kernel module won't detect them as orphan nor queue them to be removed.
"btrfs subvolume delete -i" do no helps, as it still requires ROOT_BACKREF to resolve the dentry.
For now, we should teach btrfs check to detect and repair the case by adding new orphan items for them.
The root cause I guess is some strange behavior for orphan item insert and subvolume unlink.
As the report mentioned that he had one forced power off.
Qu Wenruo (3):
btrfs-progs: check/lowmem: add the ability to detect and repair orphan
subvolume trees which doesn't have orphan item
btrfs-progs: check/original: detect and repair orphan subvolume
without orphan item
btrfs-progs: fsck-tests: add test image for orphan roots without an
orphan item
check/main.c | 37 ++++-------- check/mode-common.c | 56 ++++++++++++++++++ check/mode-common.h | 3 + check/mode-lowmem.c | 42 +++++++------ .../048-orphan-roots/.lowmem_repairable | 0 .../048-orphan-roots/default.img.xz | Bin 0 -> 2584 bytes 6 files changed, 93 insertions(+), 45 deletions(-) create mode 100644 tests/fsck-tests/048-orphan-roots/.lowmem_repairable create mode 100644 tests/fsck-tests/048-orphan-roots/default.img.xz
Signature · 1 line
2.32.0