diff options
-rw-r--r-- | fs/ext3/namei.c | 10 | ||||
-rw-r--r-- | fs/ext4/namei.c | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 9bb046df827a..1586807b8177 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -1019,6 +1019,11 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str | |||
1019 | 1019 | ||
1020 | if (!inode) | 1020 | if (!inode) |
1021 | return ERR_PTR(-EACCES); | 1021 | return ERR_PTR(-EACCES); |
1022 | |||
1023 | if (is_bad_inode(inode)) { | ||
1024 | iput(inode); | ||
1025 | return ERR_PTR(-ENOENT); | ||
1026 | } | ||
1022 | } | 1027 | } |
1023 | return d_splice_alias(inode, dentry); | 1028 | return d_splice_alias(inode, dentry); |
1024 | } | 1029 | } |
@@ -1054,6 +1059,11 @@ struct dentry *ext3_get_parent(struct dentry *child) | |||
1054 | if (!inode) | 1059 | if (!inode) |
1055 | return ERR_PTR(-EACCES); | 1060 | return ERR_PTR(-EACCES); |
1056 | 1061 | ||
1062 | if (is_bad_inode(inode)) { | ||
1063 | iput(inode); | ||
1064 | return ERR_PTR(-ENOENT); | ||
1065 | } | ||
1066 | |||
1057 | parent = d_alloc_anon(inode); | 1067 | parent = d_alloc_anon(inode); |
1058 | if (!parent) { | 1068 | if (!parent) { |
1059 | iput(inode); | 1069 | iput(inode); |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 2811e5720ad0..2de339dd7554 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -1017,6 +1017,11 @@ static struct dentry *ext4_lookup(struct inode * dir, struct dentry *dentry, str | |||
1017 | 1017 | ||
1018 | if (!inode) | 1018 | if (!inode) |
1019 | return ERR_PTR(-EACCES); | 1019 | return ERR_PTR(-EACCES); |
1020 | |||
1021 | if (is_bad_inode(inode)) { | ||
1022 | iput(inode); | ||
1023 | return ERR_PTR(-ENOENT); | ||
1024 | } | ||
1020 | } | 1025 | } |
1021 | return d_splice_alias(inode, dentry); | 1026 | return d_splice_alias(inode, dentry); |
1022 | } | 1027 | } |
@@ -1052,6 +1057,11 @@ struct dentry *ext4_get_parent(struct dentry *child) | |||
1052 | if (!inode) | 1057 | if (!inode) |
1053 | return ERR_PTR(-EACCES); | 1058 | return ERR_PTR(-EACCES); |
1054 | 1059 | ||
1060 | if (is_bad_inode(inode)) { | ||
1061 | iput(inode); | ||
1062 | return ERR_PTR(-ENOENT); | ||
1063 | } | ||
1064 | |||
1055 | parent = d_alloc_anon(inode); | 1065 | parent = d_alloc_anon(inode); |
1056 | if (!parent) { | 1066 | if (!parent) { |
1057 | iput(inode); | 1067 | iput(inode); |