linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes()
Date: Thu, 8 Aug 2013 13:18:15 +0800	[thread overview]
Message-ID: <20130808051813.GA644@localhost.localdomain> (raw)
In-Reply-To: <1375938259-5015-1-git-send-email-wangsl.fnst@cn.fujitsu.com>

On Thu, Aug 08, 2013 at 01:04:17PM +0800, Wang Shilong wrote:
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>

Sorry, I don't think I understand why it's a memory leak, some explanation
is needed here.

-liubo

> ---
>  fs/btrfs/backref.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
> index cb73a12..54e7610 100644
> --- a/fs/btrfs/backref.c
> +++ b/fs/btrfs/backref.c
> @@ -911,7 +911,6 @@ again:
>  
>  	while (!list_empty(&prefs)) {
>  		ref = list_first_entry(&prefs, struct __prelim_ref, list);
> -		list_del(&ref->list);
>  		WARN_ON(ref->count < 0);
>  		if (ref->count && ref->root_id && ref->parent == 0) {
>  			/* no parent == root of tree */
> @@ -954,6 +953,7 @@ again:
>  				eie->next = ref->inode_list;
>  			}
>  		}
> +		list_del(&ref->list);
>  		kfree(ref);
>  	}
>  
> -- 
> 1.8.0.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-08-08  5:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08  5:04 [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes() Wang Shilong
2013-08-08  5:04 ` [PATCH 2/3] Btrfs: catch error return value from find_extent_in_eb() Wang Shilong
2013-08-08 10:24   ` Filipe David Manana
2013-08-08 11:01     ` Wang Shilong
2013-08-08 11:06     ` Jan Schmidt
2013-08-08  5:04 ` [PATCH 3/3] Btrfs: allocate prelim_ref with a slab allocater Wang Shilong
2013-08-08 11:25   ` Jan Schmidt
2013-08-08 11:39     ` Wang Shilong
2013-08-08 14:19   ` David Sterba
2013-08-08  5:18 ` Liu Bo [this message]
2013-08-08  5:22 ` [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes() Liu Bo
2013-08-08  5:37   ` Miao Xie
2013-08-08 11:02 ` Jan Schmidt
2013-08-08 11:02   ` Wang Shilong

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=20130808051813.GA644@localhost.localdomain \
    --to=bo.li.liu@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangsl.fnst@cn.fujitsu.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).