From: Josef Bacik <josef@toxicpanda.com>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs-progs: fix a memory leak when starting a transaction on fs with error
Date: Mon, 18 Apr 2022 11:26:47 -0400 [thread overview]
Message-ID: <Yl2DN8CyzdpZE3jh@localhost.localdomain> (raw)
In-Reply-To: <0aa27221eba9359cd566fc6448d46b12583211f2.1650287150.git.wqu@suse.com>
On Mon, Apr 18, 2022 at 09:10:07PM +0800, Qu Wenruo wrote:
> Function btrfs_start_transaction() will allocate the memory
> unconditionally, but if the fs has an aborted transaction we don't free
> the allocated memory but return error directly.
>
> Fix it by only allocate the new memory after the transaction_aborted
> check.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Thanks,
Josef
next prev parent reply other threads:[~2022-04-18 15:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 13:10 [PATCH 0/2] btrfs-progs: bug fixes exposed during delayed chunk items insertion Qu Wenruo
2022-04-18 13:10 ` [PATCH 1/2] btrfs-progs: fix a memory leak when starting a transaction on fs with error Qu Wenruo
2022-04-18 15:26 ` Josef Bacik [this message]
2022-04-19 5:09 ` Andrei Borzenkov
2022-04-19 6:42 ` Qu Wenruo
2022-04-18 13:10 ` [PATCH 2/2] btrfs-progs: fix an error path which can lead to empty device list Qu Wenruo
2022-04-18 15:28 ` Josef Bacik
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=Yl2DN8CyzdpZE3jh@localhost.localdomain \
--to=josef@toxicpanda.com \
--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