linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: robbieko <robbieko@synology.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: super-recover: fix double free fs_devices memory
Date: Wed, 24 Oct 2018 20:44:43 +0200	[thread overview]
Message-ID: <20181024184443.GA16290@twin.jikos.cz> (raw)
In-Reply-To: <1539332723-5868-1-git-send-email-robbieko@synology.com>

On Fri, Oct 12, 2018 at 04:25:23PM +0800, robbieko wrote:
> From: Robbie Ko <robbieko@synology.com>
> 
> super-recover collects btrfs devices information using existed
> functions scan_one_devices().
> 
> Problem is fs_devices is freed twice. One in __open_ctree_fd() when
> error happens and the other in btrfs_close_devices(recover.fs_devices)
> when root is NULL.
> 
> Commit "30fd6f2e92695c355c8f76b8887cd4fade60cdac" add force-close
> all opened device before program exit, to avoid memory leak in all
> btrfs sub-command.
> Therefore, there is an unnecessary freed of fs_devices in
> btrfs_recover_superblocks.
> 
> Fix this problem by remove unnecessary freed of fs_devices.
> 
> Signed-off-by: Robbie Ko <robbieko@synology.com>

The fix for the double free has been in the devel branch, but thanks
anyway.

  reply	other threads:[~2018-10-24 18:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12  8:25 [PATCH] btrfs-progs: super-recover: fix double free fs_devices memory robbieko
2018-10-24 18:44 ` David Sterba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-09-17 17:00 "btrfs rescue super-recover" memory corruption Eric Sandeen
2014-09-18  9:01 ` [PATCH] Btrfs-progs: super-recover: fix double free fs_devices memory Wang Shilong
2014-09-18  9:23   ` Gui Hecheng
2014-09-22 20:39   ` Eric Sandeen

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=20181024184443.GA16290@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=robbieko@synology.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;
as well as URLs for NNTP newsgroup(s).