mbox series

[0/2] btrfs: add a delayed ref self test

Message ID cover.1731614132.git.josef@toxicpanda.com (mailing list archive)
Headers show
Series btrfs: add a delayed ref self test | expand

Message

Josef Bacik Nov. 14, 2024, 7:57 p.m. UTC
Hello,

I made a silly mistake when refactoring the delayed ref code to make it easier
to understand, and that resulted in a whole lot of not fun trying to find what
went wrong with boxes started falling over when we were deploying 6.11.  This
style of bug is easy to catch with basic unit testing, so add a variety of unit
tests for delayed refs to make sure I don't break things again.  One patch moves
an important helper and exports it so that we can do the testing, the other
patch is a giant patch of all the tests with a few changes that are necessary to
make everything work.  I validated these work properly and catch a variety of
bugs that I hand introduced to the delayed ref code.  Thanks,

Josef Bacik (2):
  btrfs: move select_delayed_ref and export it
  btrfs: add delayed ref self tests

 fs/btrfs/Makefile                   |    2 +-
 fs/btrfs/delayed-ref.c              |   41 +-
 fs/btrfs/delayed-ref.h              |    2 +
 fs/btrfs/extent-tree.c              |   26 +-
 fs/btrfs/tests/btrfs-tests.c        |   18 +
 fs/btrfs/tests/btrfs-tests.h        |    6 +
 fs/btrfs/tests/delayed-refs-tests.c | 1012 +++++++++++++++++++++++++++
 7 files changed, 1078 insertions(+), 29 deletions(-)
 create mode 100644 fs/btrfs/tests/delayed-refs-tests.c

Comments

Boris Burkov Nov. 14, 2024, 10:24 p.m. UTC | #1
On Thu, Nov 14, 2024 at 02:57:47PM -0500, Josef Bacik wrote:
> Hello,
> 
> I made a silly mistake when refactoring the delayed ref code to make it easier
> to understand, and that resulted in a whole lot of not fun trying to find what
> went wrong with boxes started falling over when we were deploying 6.11.  This
> style of bug is easy to catch with basic unit testing, so add a variety of unit
> tests for delayed refs to make sure I don't break things again.  One patch moves
> an important helper and exports it so that we can do the testing, the other
> patch is a giant patch of all the tests with a few changes that are necessary to
> make everything work.  I validated these work properly and catch a variety of
> bugs that I hand introduced to the delayed ref code.  Thanks,

These are great, thanks.

I brought up some high level but non-blocking thoughts/questions
on the test patch, but please feel free to add

Reviewed-by: Boris Burkov <boris@bur.io>

> 
> Josef Bacik (2):
>   btrfs: move select_delayed_ref and export it
>   btrfs: add delayed ref self tests
> 
>  fs/btrfs/Makefile                   |    2 +-
>  fs/btrfs/delayed-ref.c              |   41 +-
>  fs/btrfs/delayed-ref.h              |    2 +
>  fs/btrfs/extent-tree.c              |   26 +-
>  fs/btrfs/tests/btrfs-tests.c        |   18 +
>  fs/btrfs/tests/btrfs-tests.h        |    6 +
>  fs/btrfs/tests/delayed-refs-tests.c | 1012 +++++++++++++++++++++++++++
>  7 files changed, 1078 insertions(+), 29 deletions(-)
>  create mode 100644 fs/btrfs/tests/delayed-refs-tests.c
> 
> -- 
> 2.43.0
>