From: Qu Wenruo <wqu@suse.com>
To: fdmanana@kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: tests: fix chunk map leak after failure to add it to the tree
Date: Wed, 12 Mar 2025 07:55:18 +1030 [thread overview]
Message-ID: <79938ae8-eb2b-45da-af35-d4e63e09064c@suse.com> (raw)
In-Reply-To: <f05862e33146ef046f6d377b8b2663b69f2c2e84.1741709026.git.fdmanana@suse.com>
在 2025/3/12 02:36, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
>
> If we fail to add the chunk map to the fs mapping tree we exit
> test_rmap_block() without freeing the chunk map. Fix this by adding a
> call to btrfs_free_chunk_map() before exiting the test function if the
> call to btrfs_add_chunk_map() failed.
>
> Fixes: 7dc66abb5a47 ("btrfs: use a dedicated data structure for chunk maps")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> fs/btrfs/tests/extent-map-tests.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/btrfs/tests/extent-map-tests.c b/fs/btrfs/tests/extent-map-tests.c
> index 56e61ac1cc64..609bb6c9c087 100644
> --- a/fs/btrfs/tests/extent-map-tests.c
> +++ b/fs/btrfs/tests/extent-map-tests.c
> @@ -1045,6 +1045,7 @@ static int test_rmap_block(struct btrfs_fs_info *fs_info,
> ret = btrfs_add_chunk_map(fs_info, map);
> if (ret) {
> test_err("error adding chunk map to mapping tree");
> + btrfs_free_chunk_map(map);
> goto out_free;
> }
>
prev parent reply other threads:[~2025-03-11 21:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 16:06 [PATCH] btrfs: tests: fix chunk map leak after failure to add it to the tree fdmanana
2025-03-11 16:19 ` Boris Burkov
2025-03-11 21:25 ` 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=79938ae8-eb2b-45da-af35-d4e63e09064c@suse.com \
--to=wqu@suse.com \
--cc=fdmanana@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/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 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.