[PATCH 0/3] btrfs-progs: make check handle invalid bg items
From: Josef Bacik <josef@toxicpanda.com>
Date: 2021-08-18 04:39:27
Hello, While writing code for extent tree v2 I noticed that I was generating a fs with an invalid block group ->used value. However fsck wasn't catching this, because we don't actuall check the used value of the block group items in normal mode. lowmem mode does this properly thankfully, so this only needs to be added to the normal fsck mode. I've added code to btrfs-corrupt-block to generate the corrupt image I need for the test case. Then of course the actual patch to detect and fix the problem. Thanks, Josef Josef Bacik (3): btrfs-progs: add the ability to corrupt block group items btrfs-progs: make check detect and fix invalid used for block groups btrfs-progs: add a test image with a corrupt block group item btrfs-corrupt-block.c | 108 +++++++++++++++++- check/common.h | 5 + check/main.c | 89 ++++++++++++++- .../default.img.xz | Bin 0 -> 1036 bytes 4 files changed, 197 insertions(+), 5 deletions(-) create mode 100644 tests/fsck-tests/050-invalid-block-group-used/default.img.xz -- 2.26.3