All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: Jan Schmidt <list.btrfs@jan-o-sch.net>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes()
Date: Thu, 08 Aug 2013 19:02:36 +0800	[thread overview]
Message-ID: <52037ACC.10502@cn.fujitsu.com> (raw)
In-Reply-To: <52037AC6.70508@jan-o-sch.net>

On 08/08/2013 07:02 PM, Jan Schmidt wrote:
>  
> On Thu, August 08, 2013 at 07:04 (+0200), Wang Shilong wrote:
>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>> Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
>> ---
>>  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);
>>  	}
>>  
>>
> 
> I'm not convinced, you're not calling kfree() more often. Can you please add
> some patch description?

Yeah. i will add more description in V2.

Thanks
Wang
> 
> -Jan
> 


      reply	other threads:[~2013-08-08 11:13 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 ` [PATCH 1/3] Btrfs: fix possible memory leak in find_parent_nodes() Liu Bo
2013-08-08  5:22 ` Liu Bo
2013-08-08  5:37   ` Miao Xie
2013-08-08 11:02 ` Jan Schmidt
2013-08-08 11:02   ` Wang Shilong [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=52037ACC.10502@cn.fujitsu.com \
    --to=wangsl.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=list.btrfs@jan-o-sch.net \
    /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.