ext2: ext2_find_entry() return -ENOENT if no entry found
authorzhangyi (F) <yi.zhang@huawei.com>
Mon, 8 Jun 2020 03:40:43 +0000 (11:40 +0800)
committerJan Kara <jack@suse.cz>
Thu, 9 Jul 2020 06:14:00 +0000 (08:14 +0200)
commita43850a380ef56009ce721737b0c08984b663b99
treed45a10e93abd3bde1853699d93c45cc40706d99b
parentb4962091a54c8c332e4c6c211a86b7f6d6e1f759
ext2: ext2_find_entry() return -ENOENT if no entry found

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().

Link: https://lore.kernel.org/r/20200608034043.10451-2-yi.zhang@huawei.com
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/dir.c
fs/ext2/namei.c