mbox series

[0/3] btrfs-progs: add eb leak detection and fixes

Message ID cover.1693945163.git.josef@toxicpanda.com (mailing list archive)
Headers show
Series btrfs-progs: add eb leak detection and fixes | expand

Message

Josef Bacik Sept. 5, 2023, 8:21 p.m. UTC
Hello,

I introduced an EB leak that we only discovered when we started running fstests
with my code applied to the btrfs-progs devel branch.  We really want to detect
this before we start using this code for fstests, so update all the run_check
related helpers to use a helper that will check for extent buffer leaks and fail
accordingly.  This will allow developers to discover they've introduced a
problem when they run make test after their changes.

This functionality of course uncovered a few leaks that currently exist in
btrfs-progs, so there are two fixes that precede the leak detection work in
order to make sure we are clean from the leak detection commit ondwards.
Thanks,

Josef

Josef Bacik (3):
  btrfs-progs: cleanup dirty buffers on transaction abort
  btrfs-progs: properly cleanup aborted transactions in check
  btrfs-progs: add extent buffer leak detection to make test

 check/main.c                |  10 +++-
 kernel-shared/transaction.c |  45 ++++++++-------
 tests/common                | 108 ++++++++++++++++++++----------------
 3 files changed, 95 insertions(+), 68 deletions(-)

Comments

David Sterba Sept. 8, 2023, 12:08 p.m. UTC | #1
On Tue, Sep 05, 2023 at 04:21:50PM -0400, Josef Bacik wrote:
> Hello,
> 
> I introduced an EB leak that we only discovered when we started running fstests
> with my code applied to the btrfs-progs devel branch.  We really want to detect
> this before we start using this code for fstests, so update all the run_check
> related helpers to use a helper that will check for extent buffer leaks and fail
> accordingly.  This will allow developers to discover they've introduced a
> problem when they run make test after their changes.
> 
> This functionality of course uncovered a few leaks that currently exist in
> btrfs-progs, so there are two fixes that precede the leak detection work in
> order to make sure we are clean from the leak detection commit ondwards.
> Thanks,
> 
> Josef
> 
> Josef Bacik (3):
>   btrfs-progs: cleanup dirty buffers on transaction abort
>   btrfs-progs: properly cleanup aborted transactions in check
>   btrfs-progs: add extent buffer leak detection to make test

1 and 2 added to devel, the leak detection is done in a different way,
thanks.