aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 67b6d8a1ceff..d153bb5922fc 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1039,17 +1039,11 @@ static struct dentry *ext4_lookup(struct inode * dir, struct dentry *dentry, str
1039 if (!ext4_valid_inum(dir->i_sb, ino)) { 1039 if (!ext4_valid_inum(dir->i_sb, ino)) {
1040 ext4_error(dir->i_sb, "ext4_lookup", 1040 ext4_error(dir->i_sb, "ext4_lookup",
1041 "bad inode number: %lu", ino); 1041 "bad inode number: %lu", ino);
1042 inode = NULL; 1042 return ERR_PTR(-EIO);
1043 } else
1044 inode = iget(dir->i_sb, ino);
1045
1046 if (!inode)
1047 return ERR_PTR(-EACCES);
1048
1049 if (is_bad_inode(inode)) {
1050 iput(inode);
1051 return ERR_PTR(-ENOENT);
1052 } 1043 }
1044 inode = ext4_iget(dir->i_sb, ino);
1045 if (IS_ERR(inode))
1046 return ERR_CAST(inode);
1053 } 1047 }
1054 return d_splice_alias(inode, dentry); 1048 return d_splice_alias(inode, dentry);
1055} 1049}
@@ -1078,18 +1072,13 @@ struct dentry *ext4_get_parent(struct dentry *child)
1078 if (!ext4_valid_inum(child->d_inode->i_sb, ino)) { 1072 if (!ext4_valid_inum(child->d_inode->i_sb, ino)) {
1079 ext4_error(child->d_inode->i_sb, "ext4_get_parent", 1073 ext4_error(child->d_inode->i_sb, "ext4_get_parent",
1080 "bad inode number: %lu", ino); 1074 "bad inode number: %lu", ino);
1081 inode = NULL; 1075 return ERR_PTR(-EIO);
1082 } else
1083 inode = iget(child->d_inode->i_sb, ino);
1084
1085 if (!inode)
1086 return ERR_PTR(-EACCES);
1087
1088 if (is_bad_inode(inode)) {
1089 iput(inode);
1090 return ERR_PTR(-ENOENT);
1091 } 1076 }
1092 1077
1078 inode = ext4_iget(child->d_inode->i_sb, ino);
1079 if (IS_ERR(inode))
1080 return ERR_CAST(inode);
1081
1093 parent = d_alloc_anon(inode); 1082 parent = d_alloc_anon(inode);
1094 if (!parent) { 1083 if (!parent) {
1095 iput(inode); 1084 iput(inode);