All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Holger Hoffstätte" <holger@applied-asynchrony.com>
To: Liu Bo <bo.li.liu@oracle.com>, linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.cz>, Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH] Btrfs: fix memory leak in do_walk_down
Date: Wed, 14 Sep 2016 15:19:18 +0200	[thread overview]
Message-ID: <57D94E56.7040501@applied-asynchrony.com> (raw)
In-Reply-To: <1473818547-615-1-git-send-email-bo.li.liu@oracle.com>

On 09/14/16 04:02, Liu Bo wrote:
> The extent buffer 'next' needs to be free'd conditionally.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>  fs/btrfs/extent-tree.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 5a940ab..779fd72 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -8882,6 +8882,7 @@ static noinline int do_walk_down(struct btrfs_trans_handle *trans,
>  				       &wc->flags[level - 1]);
>  	if (ret < 0) {
>  		btrfs_tree_unlock(next);
> +		free_extent_buffer(next);
>  		return ret;
>  	}
>  
> 

This was fixed a long time ago by the following patch by Josef:

"Btrfs: don't BUG() during drop snapshot"
https://patchwork.kernel.org/patch/7002791/

..which never got merged. I've been using it since 4.1.x until today
without problems.

Note that apparently Patchwork got confused here: downloading only the
"patch" fragment won't work; you'll need the full "mbox" attachment.
It also seems to have been sorted into the wrong list bucket for some
reason.

-h


  reply	other threads:[~2016-09-14 13:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  2:02 [PATCH] Btrfs: fix memory leak in do_walk_down Liu Bo
2016-09-14 13:19 ` Holger Hoffstätte [this message]
2016-09-22 15:01   ` David Sterba
2016-09-22 15:10 ` David Sterba
2016-09-22 17:57   ` Liu Bo

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=57D94E56.7040501@applied-asynchrony.com \
    --to=holger@applied-asynchrony.com \
    --cc=bo.li.liu@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=jbacik@fb.com \
    --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.