btrfs-progs: add check and repair ability for shrunk device item
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs-progs: check: verify the underlying block device size is validcheck/ check/ | +50 | 0 replies | |
| 2/3 | btrfs-progs: fsck-tests: add test case for shrunk devicetests/ | +32 | 0 replies | |
| 3/3 | btrfs-progs: rescue: allow fix-device-size to shrink device itemkernel-shared/ | +126 | 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: add check and repair ability for shrunk device item
There is a bug report that, a btrfs with shrunk underlying device will be rejected by kernel, but btrfs-check will report nothing wrong.
Furthermore for such case, even if there is no dev extent in the shrunk range, we have no way to fix it.
Kernel will refuse to mount, thus no way to shrink the device using "btrfs dev resize".
This patch will:
- Add check ability to report such mismatch
- Add rescue ability to reset the total_bytes in dev items This can only be done if there is no dev extent in the shrunk range.
- Add a test case for above behavior
Qu Wenruo (3):
btrfs-progs: check: verify the underlying block device size is valid
btrfs-progs: fsck-tests: add test case for shrunk device
btrfs-progs: rescue: allow fix-device-size to shrink device item
check/main.c | 28 ++++ check/mode-lowmem.c | 22 +++ kernel-shared/volumes.c | 135 +++++++++++++++++-- tests/fsck-tests/059-shrinked-device/test.sh | 32 +++++ 4 files changed, 208 insertions(+), 9 deletions(-) create mode 100755 tests/fsck-tests/059-shrinked-device/test.sh
Signature · 1 line
2.37.2