[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <13a18e5f-faea-f8b6-1072-8e911975ddc2@huawei.com>
Date: Mon, 8 Jun 2020 09:20:00 +0800
From: "zhangyi (F)" <yi.zhang@...wei.com>
To: Jan Kara <jack@...e.cz>
CC: <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] ext2: ext2_find_entry() return -ENOENT if no entry
found
On 2020/6/5 23:11, Jan Kara wrote:
> On Wed 03-06-20 14:35:14, zhangyi (F) wrote:
>> Almost all callers of ext2_find_entry() transform NULL return value to
>> -ENOENT, so just let ext2_find_entry() retuen -ENOENT instead of NULL
>> if no valid entry found, and also switch to check the return value of
>> ext2_inode_by_name() in ext2_lookup() and ext2_get_parent().
>>
>> Signed-off-by: zhangyi (F) <yi.zhang@...wei.com>
>> Suggested-by: Jan Kara <jack@...e.cz>
>
> Thanks for the patch. Just one small nit below.
>
>> @@ -419,11 +419,16 @@ int ext2_inode_by_name(struct inode *dir, const struct qstr *child, ino_t *ino)
>> struct page *page;
>>
>> de = ext2_find_entry(dir, child, &page);
>> - if (IS_ERR_OR_NULL(de))
>> + if (IS_ERR(de))
>> return PTR_ERR(de);
>>
>> - *ino = le32_to_cpu(de->inode);
>> ext2_put_page(page);
>> + if (!de->inode) {
>
> ext2_find_entry() will not ever return de with de->inode == 0 because
> ext2_match() never returns true for such entries. So I'd just remove this
> condition...
>
Indeed, I missed this point, will do.
Thanks,
Yi.
Powered by blists - more mailing lists