linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	Qu Wenruo <wqu@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] btrfs: relocation: Use btrfs_backref_iterator infrastructure
Date: Fri, 14 Feb 2020 17:36:55 +0800	[thread overview]
Message-ID: <6b9f7d71-2164-e74d-42bf-92e1aaa8153d@gmx.com> (raw)
In-Reply-To: <SN4PR0401MB3598CB039EE0C0220A06F6039B150@SN4PR0401MB3598.namprd04.prod.outlook.com>


[-- Attachment #1.1: Type: text/plain, Size: 1001 bytes --]



On 2020/2/14 下午5:00, Johannes Thumshirn wrote:
> On 14/02/2020 09:14, Qu Wenruo wrote:
>> @@ -677,9 +635,6 @@ struct backref_node *build_backref_tree(struct reloc_control *rc,
>>   	struct backref_node *exist = NULL;
>>   	struct backref_edge *edge;
>>   	struct rb_node *rb_node;
>> -	struct btrfs_key key;
>> -	unsigned long end;
>> -	unsigned long ptr;
>>   	LIST_HEAD(list); /* Pending edge list, upper node needs to be checked */
>>   	LIST_HEAD(useless);
>>   	int cowonly;
>> @@ -687,14 +642,14 @@ struct backref_node *build_backref_tree(struct reloc_control *rc,
>>   	int err = 0;
>>   	bool need_check = true;
>>   
>> -	path1 = btrfs_alloc_path();
>> -	path2 = btrfs_alloc_path();
>> -	if (!path1 || !path2) {
>> +	iterator = btrfs_backref_iterator_alloc(rc->extent_root->fs_info,
>> +						GFP_NOFS);
> 
> btrfs_backref_iterator_alloc() can fail and I don't see where a
> iterator == NULL condition is handled.
> 
Oops.

Thanks for catching this!
Qu


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-02-14  9:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14  8:13 [PATCH v2 0/3] Btrfs: relocation: Refactor build_backref_tree() using btrfs_backref_iterator infrastructure Qu Wenruo
2020-02-14  8:13 ` [PATCH v2 1/3] btrfs: backref: Introduce the skeleton of btrfs_backref_iterator Qu Wenruo
2020-02-14  8:53   ` Johannes Thumshirn
2020-02-14  9:19   ` Nikolay Borisov
2020-02-14  9:33     ` Qu Wenruo
2020-02-14  9:36       ` Nikolay Borisov
2020-02-14  9:24   ` Nikolay Borisov
2020-02-14  9:34     ` Qu Wenruo
2020-02-14  8:13 ` [PATCH v2 2/3] btrfs: backref: Implement btrfs_backref_iterator_next() Qu Wenruo
2020-02-14  9:25   ` Nikolay Borisov
2020-02-14  9:28     ` Nikolay Borisov
2020-02-14  9:35     ` Qu Wenruo
2020-02-14  8:13 ` [PATCH v2 3/3] btrfs: relocation: Use btrfs_backref_iterator infrastructure Qu Wenruo
2020-02-14  9:00   ` Johannes Thumshirn
2020-02-14  9:36     ` Qu Wenruo [this message]
2020-02-14  9:29   ` Nikolay Borisov

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=6b9f7d71-2164-e74d-42bf-92e1aaa8153d@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=Johannes.Thumshirn@wdc.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;
as well as URLs for NNTP newsgroup(s).