Commit eb4246dc authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: return error of f2fs_lookup

Now we can report an error to f2fs_lookup given by f2fs_find_entry.
Suggested-by: default avatarHe YunLei <heyunlei@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 0c9df7fb
......@@ -230,7 +230,7 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
err = fscrypt_setup_filename(dir, child, 1, &fname);
if (err) {
*res_page = ERR_PTR(-ENOMEM);
*res_page = ERR_PTR(err);
return NULL;
}
......
......@@ -287,8 +287,11 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
return ERR_PTR(-ENAMETOOLONG);
de = f2fs_find_entry(dir, &dentry->d_name, &page);
if (!de)
if (!de) {
if (IS_ERR(page))
return (struct dentry *)page;
return d_splice_alias(inode, dentry);
}
ino = le32_to_cpu(de->ino);
f2fs_dentry_kunmap(dir, page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment