public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Leo Martins <loemra.dev@gmail.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 2/2] btrfs: warn if leaking delayed_nodes
Date: Wed, 28 May 2025 07:46:55 +0930	[thread overview]
Message-ID: <7bf0af35-45a8-4395-acec-4a98a2fbfaef@suse.com> (raw)
In-Reply-To: <023ae97cf64384f4187ff03d54f03830e904df39.1748373059.git.loemra.dev@gmail.com>



在 2025/5/28 04:58, Leo Martins 写道:
> Add a warning for leaked delayed_nodes when putting a root. We currently do this
> for inodes, but not delayed_nodes.
> 
> Signed-off-by: Leo Martins <loemra.dev@gmail.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   fs/btrfs/disk-io.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 1beb9458f622..3def93016963 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -1835,6 +1835,8 @@ void btrfs_put_root(struct btrfs_root *root)
>   	if (refcount_dec_and_test(&root->refs)) {
>   		if (WARN_ON(!xa_empty(&root->inodes)))
>   			xa_destroy(&root->inodes);
> +		if (WARN_ON(!xa_empty(&root->delayed_nodes)))
> +			xa_destroy(&root->delayed_nodes);
>   		WARN_ON(test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state));
>   		if (root->anon_dev)
>   			free_anon_bdev(root->anon_dev)

      parent reply	other threads:[~2025-05-27 22:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 19:28 [PATCH 0/2] delayed_node leak bug Leo Martins
2025-05-27 19:28 ` [PATCH 1/2] btrfs: fix refcount leak in debug assertion Leo Martins
2025-05-27 19:37   ` Filipe Manana
2025-05-27 22:16   ` Qu Wenruo
2025-05-27 19:28 ` [PATCH 2/2] btrfs: warn if leaking delayed_nodes Leo Martins
2025-05-27 19:38   ` Filipe Manana
2025-05-27 22:16   ` Qu Wenruo [this message]

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=7bf0af35-45a8-4395-acec-4a98a2fbfaef@suse.com \
    --to=wqu@suse.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=loemra.dev@gmail.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