summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-05-27 10:10:41 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-06-02 18:05:23 -0700
commiteb4246dc12da4a0369a91c10c2dfe8e2b0955818 (patch)
tree1d574db25de1e245d0a0a403ee52263439d0570a
parent0c9df7fb80360802f241428be7104f79d7c0f4ee (diff)
downloadlinux-stable-eb4246dc12da4a0369a91c10c2dfe8e2b0955818.tar.gz
linux-stable-eb4246dc12da4a0369a91c10c2dfe8e2b0955818.tar.bz2
linux-stable-eb4246dc12da4a0369a91c10c2dfe8e2b0955818.zip
f2fs: return error of f2fs_lookup
Now we can report an error to f2fs_lookup given by f2fs_find_entry. Suggested-by: He YunLei <heyunlei@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/dir.c2
-rw-r--r--fs/f2fs/namei.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index ae37543f3840..6fbb1ed182f6 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -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;
}
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 3f6119e94a78..78efe00a3a2f 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -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);