Message ID | cover.1661841983.git.wqu@suse.com (mailing list archive) |
---|---|
Headers | show |
Series | btrfs-progs: add check and repair ability for shrunk device item | expand |
On Tue, Aug 30, 2022 at 02:49:41PM +0800, Qu Wenruo wrote: > 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 Added to devel, thanks.