public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@kernel.org>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: make enough noise for fstests to catch extent buffer leakage
Date: Tue, 15 Mar 2022 11:45:05 +0000	[thread overview]
Message-ID: <YjB8QWiskKVANQ7j@debian9.Home> (raw)
In-Reply-To: <e29bd3f7a0b167cc6d7a6e40f8b3b62b88a64fc3.1647338477.git.wqu@suse.com>

On Tue, Mar 15, 2022 at 06:01:33PM +0800, Qu Wenruo wrote:
> Although we have btrfs_extent_buffer_leak_debug_check() (enabled by
> CONFIG_BTRFS_DEBUG option) to detect and warn QA testers that we have
> some extent buffer leakage, it's just pr_err(), not noisy enough for
> fstests to cache.
> 
> So here we trigger a WARN_ON_ONCE() if the allocated_ebs list is not
> empty.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  fs/btrfs/extent_io.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 78486bbd1ac9..593eafc30261 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -76,6 +76,7 @@ void btrfs_extent_buffer_leak_debug_check(struct btrfs_fs_info *fs_info)
>  		return;
>  
>  	spin_lock_irqsave(&fs_info->eb_leak_lock, flags);
> +	WARN_ON_ONCE(!list_empty(&fs_info->allocated_ebs));

I would make it WARN_ON(), so that it's less likely to get unnoticed.

Anyway:

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Thanks.

>  	while (!list_empty(&fs_info->allocated_ebs)) {
>  		eb = list_first_entry(&fs_info->allocated_ebs,
>  				      struct extent_buffer, leak_list);
> -- 
> 2.35.1
> 

  reply	other threads:[~2022-03-15 11:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 10:01 [PATCH] btrfs: make enough noise for fstests to catch extent buffer leakage Qu Wenruo
2022-03-15 11:45 ` Filipe Manana [this message]
2022-03-15 20:05 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YjB8QWiskKVANQ7j@debian9.Home \
    --to=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox