From: Qu Wenruo <wqu@suse.com>
To: Hongbo Li <lihongbo22@huawei.com>,
clm@fb.com, dsterba@suse.com, josef@toxicpanda.com
Cc: fdmanana@suse.com, linux-btrfs@vger.kernel.org, sashal@kernel.org
Subject: Re: [PATCH 6.6 v2] btrfs: free path if inline extents in range_is_hole_in_parent()
Date: Fri, 27 Feb 2026 18:24:44 +1030 [thread overview]
Message-ID: <d2e3fb3e-d085-489f-bbf4-00e293ba4e75@suse.com> (raw)
In-Reply-To: <20260227075219.2594937-1-lihongbo22@huawei.com>
在 2026/2/27 18:22, Hongbo Li 写道:
> Commit f2dc6ab3a14c ("btrfs: send: check for inline extents in
> range_is_hole_in_parent()") is a patch backported directly from
> mainline to 6.6, it does not free the path in the inline extents case.
>
> The original patch in mainline does not have this problem because
> the former commit 4ca6f24a52c4 ("btrfs: more trivial BTRFS_PATH_AUTO_FREE
> conversions") in 6.18-rc1 introduced scope-based auto-cleanup which
> avoids this issue. Since some dependencies are missing and cannot
> be directly backported, we choose to use a goto statement to avoid
> the memory leak in inline extents case.
>
> Fixes: f2dc6ab3a14c ("btrfs: send: check for inline extents in range_is_hole_in_parent()")
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> Changes since v1:
> - Update commit message as Wenruo pointed out.
> - Link to v1: https://lore.kernel.org/all/20260227064414.2314529-1-lihongbo22@huawei.com/
> ---
> fs/btrfs/send.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
> index 6768e2231d61..b107a33dfd4d 100644
> --- a/fs/btrfs/send.c
> +++ b/fs/btrfs/send.c
> @@ -6545,8 +6545,10 @@ static int range_is_hole_in_parent(struct send_ctx *sctx,
> extent_end = btrfs_file_extent_end(path);
> if (extent_end <= start)
> goto next;
> - if (btrfs_file_extent_type(leaf, fi) == BTRFS_FILE_EXTENT_INLINE)
> - return 0;
> + if (btrfs_file_extent_type(leaf, fi) == BTRFS_FILE_EXTENT_INLINE) {
> + ret = 0;
> + goto out;
> + }
> if (btrfs_file_extent_disk_bytenr(leaf, fi) == 0) {
> search_start = extent_end;
> goto next;
next prev parent reply other threads:[~2026-02-27 7:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 6:44 [PATCH 6.6] btrfs: free path if inline extents in range_is_hole_in_parent() Hongbo Li
2026-02-27 6:48 ` Qu Wenruo
2026-02-27 6:56 ` Qu Wenruo
2026-02-27 7:16 ` Hongbo Li
2026-02-27 7:20 ` Qu Wenruo
2026-02-27 7:52 ` [PATCH 6.6 v2] " Hongbo Li
2026-02-27 7:54 ` Qu Wenruo [this message]
2026-03-01 12:31 ` kernel test robot
2026-03-01 20:44 ` Qu Wenruo
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=d2e3fb3e-d085-489f-bbf4-00e293ba4e75@suse.com \
--to=wqu@suse.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=josef@toxicpanda.com \
--cc=lihongbo22@huawei.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=sashal@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox