diff options
Diffstat (limited to 'fs/ext3/namei.c')
-rw-r--r-- | fs/ext3/namei.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 92b83b004dd8..dec3e0d88ab1 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -1037,17 +1037,11 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str | |||
1037 | if (!ext3_valid_inum(dir->i_sb, ino)) { | 1037 | if (!ext3_valid_inum(dir->i_sb, ino)) { |
1038 | ext3_error(dir->i_sb, "ext3_lookup", | 1038 | ext3_error(dir->i_sb, "ext3_lookup", |
1039 | "bad inode number: %lu", ino); | 1039 | "bad inode number: %lu", ino); |
1040 | inode = NULL; | 1040 | return ERR_PTR(-EIO); |
1041 | } else | ||
1042 | inode = iget(dir->i_sb, ino); | ||
1043 | |||
1044 | if (!inode) | ||
1045 | return ERR_PTR(-EACCES); | ||
1046 | |||
1047 | if (is_bad_inode(inode)) { | ||
1048 | iput(inode); | ||
1049 | return ERR_PTR(-ENOENT); | ||
1050 | } | 1041 | } |
1042 | inode = ext3_iget(dir->i_sb, ino); | ||
1043 | if (IS_ERR(inode)) | ||
1044 | return ERR_CAST(inode); | ||
1051 | } | 1045 | } |
1052 | return d_splice_alias(inode, dentry); | 1046 | return d_splice_alias(inode, dentry); |
1053 | } | 1047 | } |
@@ -1076,18 +1070,13 @@ struct dentry *ext3_get_parent(struct dentry *child) | |||
1076 | if (!ext3_valid_inum(child->d_inode->i_sb, ino)) { | 1070 | if (!ext3_valid_inum(child->d_inode->i_sb, ino)) { |
1077 | ext3_error(child->d_inode->i_sb, "ext3_get_parent", | 1071 | ext3_error(child->d_inode->i_sb, "ext3_get_parent", |
1078 | "bad inode number: %lu", ino); | 1072 | "bad inode number: %lu", ino); |
1079 | inode = NULL; | 1073 | return ERR_PTR(-EIO); |
1080 | } else | ||
1081 | inode = iget(child->d_inode->i_sb, ino); | ||
1082 | |||
1083 | if (!inode) | ||
1084 | return ERR_PTR(-EACCES); | ||
1085 | |||
1086 | if (is_bad_inode(inode)) { | ||
1087 | iput(inode); | ||
1088 | return ERR_PTR(-ENOENT); | ||
1089 | } | 1074 | } |
1090 | 1075 | ||
1076 | inode = ext3_iget(child->d_inode->i_sb, ino); | ||
1077 | if (IS_ERR(inode)) | ||
1078 | return ERR_CAST(inode); | ||
1079 | |||
1091 | parent = d_alloc_anon(inode); | 1080 | parent = d_alloc_anon(inode); |
1092 | if (!parent) { | 1081 | if (!parent) { |
1093 | iput(inode); | 1082 | iput(inode); |