All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs-progs: make check handle invalid bg items
@ 2021-08-18  4:39 Josef Bacik
  2021-08-18  4:39 ` [PATCH 1/3] btrfs-progs: add the ability to corrupt block group items Josef Bacik
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Josef Bacik @ 2021-08-18  4:39 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-20 13:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18  4:39 [PATCH 0/3] btrfs-progs: make check handle invalid bg items Josef Bacik
2021-08-18  4:39 ` [PATCH 1/3] btrfs-progs: add the ability to corrupt block group items Josef Bacik
2021-08-20 12:58   ` David Sterba
2021-08-18  4:39 ` [PATCH 2/3] btrfs-progs: make check detect and fix invalid used for block groups Josef Bacik
2021-08-18  4:39 ` [PATCH 3/3] btrfs-progs: add a test image with a corrupt block group item Josef Bacik
2021-08-18  5:45 ` [PATCH 0/3] btrfs-progs: make check handle invalid bg items Qu Wenruo
2021-08-20 12:57 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.