f2fs: propagate error given by f2fs_find_entry

If we get ENOMEM or EIO in f2fs_find_entry, we should stop right away.
Otherwise, for example, we can get duplicate directory entry by ->chash and
->clevel.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim
2016-05-25 14:29:11 -07:00
parent b93f771286
commit 42d964016e
3 changed files with 24 additions and 8 deletions

View File

@ -286,8 +286,10 @@ struct f2fs_dir_entry *find_in_inline_dir(struct inode *dir,
f2fs_hash_t namehash;
ipage = get_node_page(sbi, dir->i_ino);
if (IS_ERR(ipage))
if (IS_ERR(ipage)) {
*res_page = ipage;
return NULL;
}
namehash = f2fs_dentry_hash(&name);