From: David Sterba <dsterba@suse.cz>
To: Zilin Guan <zilin@seu.edu.cn>
Cc: clm@fb.com, dsterba@suse.com, sunk67188@gmail.com,
dan.carpenter@linaro.org, linux-btrfs@vger.kernel.org,
linux-kernel@vger.kernel.org, jianhao.xu@seu.edu.cn
Subject: Re: [PATCH v2] btrfs: tests: Fix memory leak in btrfs_test_qgroups()
Date: Tue, 6 Jan 2026 13:38:45 +0100 [thread overview]
Message-ID: <20260106123845.GD21071@twin.jikos.cz> (raw)
In-Reply-To: <20251226113022.1883689-1-zilin@seu.edu.cn>
On Fri, Dec 26, 2025 at 11:30:22AM +0000, Zilin Guan wrote:
> If btrfs_insert_fs_root() fails, the tmp_root allocated by
> btrfs_alloc_dummy_root() is leaked because its initial reference count
> is not decremented.
>
> Fix this by calling btrfs_put_root() unconditionally after
> btrfs_insert_fs_root(). This ensures the local reference is always
> dropped.
>
> Also fix a copy-paste error in the error message where the subvolume
> root insertion failure was incorrectly logged as "fs root".
>
> Co-developed-by: Jianhao Xu <jianhao.xu@seu.edu.cn>
> Signed-off-by: Jianhao Xu <jianhao.xu@seu.edu.cn>
> Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
> ---
> Changes in v2:
> - Reword commit message to be more concise.
> - Fix copy-paste error in the error message.
> - Add Co-developed-by and Signed-off-by tag.
Added to for-next, thanks.
prev parent reply other threads:[~2026-01-06 12:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-26 11:30 Zilin Guan
2026-01-06 12:38 ` David Sterba [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=20260106123845.GD21071@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=clm@fb.com \
--cc=dan.carpenter@linaro.org \
--cc=dsterba@suse.com \
--cc=jianhao.xu@seu.edu.cn \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sunk67188@gmail.com \
--cc=zilin@seu.edu.cn \
/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
all inboxes | Powered by JetHome®