summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/namei.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-06-09 23:57:19 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2016-07-06 19:44:06 +0200
commit3e19886eda963f0c1438b2d1a40334d421cd09a2 (patch)
tree884797e9591cb0fdb0f33a144119b5e924723b08 /fs/f2fs/namei.c
parentf2fs: find parent dentry correctly (diff)
downloadlinux-3e19886eda963f0c1438b2d1a40334d421cd09a2.tar.xz
linux-3e19886eda963f0c1438b2d1a40334d421cd09a2.zip
f2fs: report error for f2fs_parent_dir
If there is no dentry, we can report its error correctly. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/namei.c')
-rw-r--r--fs/f2fs/namei.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 78efe00a3a2f..618829e8049c 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -662,10 +662,11 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
goto out;
if (S_ISDIR(old_inode->i_mode)) {
- err = -EIO;
old_dir_entry = f2fs_parent_dir(old_inode, &old_dir_page);
- if (!old_dir_entry)
+ if (!old_dir_entry) {
+ err = PTR_ERR(old_dir_page);
goto out_old;
+ }
}
if (flags & RENAME_WHITEOUT) {
@@ -838,19 +839,21 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
/* prepare for updating ".." directory entry info later */
if (old_dir != new_dir) {
if (S_ISDIR(old_inode->i_mode)) {
- err = -EIO;
old_dir_entry = f2fs_parent_dir(old_inode,
&old_dir_page);
- if (!old_dir_entry)
+ if (!old_dir_entry) {
+ err = PTR_ERR(old_dir_page);
goto out_new;
+ }
}
if (S_ISDIR(new_inode->i_mode)) {
- err = -EIO;
new_dir_entry = f2fs_parent_dir(new_inode,
&new_dir_page);
- if (!new_dir_entry)
+ if (!new_dir_entry) {
+ err = PTR_ERR(new_dir_page);
goto out_old_dir;
+ }
}
}