diff options
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |