|
@@ -1542,7 +1542,7 @@ static inline int walk_component(struct nameidata *nd, struct path *path,
|
|
inode = path->dentry->d_inode;
|
|
inode = path->dentry->d_inode;
|
|
}
|
|
}
|
|
err = -ENOENT;
|
|
err = -ENOENT;
|
|
- if (!inode)
|
|
|
|
|
|
+ if (!inode || d_is_negative(path->dentry))
|
|
goto out_path_put;
|
|
goto out_path_put;
|
|
|
|
|
|
if (should_follow_link(path->dentry, follow)) {
|
|
if (should_follow_link(path->dentry, follow)) {
|
|
@@ -2249,7 +2249,7 @@ mountpoint_last(struct nameidata *nd, struct path *path)
|
|
mutex_unlock(&dir->d_inode->i_mutex);
|
|
mutex_unlock(&dir->d_inode->i_mutex);
|
|
|
|
|
|
done:
|
|
done:
|
|
- if (!dentry->d_inode) {
|
|
|
|
|
|
+ if (!dentry->d_inode || d_is_negative(dentry)) {
|
|
error = -ENOENT;
|
|
error = -ENOENT;
|
|
dput(dentry);
|
|
dput(dentry);
|
|
goto out;
|
|
goto out;
|
|
@@ -2994,7 +2994,7 @@ retry_lookup:
|
|
finish_lookup:
|
|
finish_lookup:
|
|
/* we _can_ be in RCU mode here */
|
|
/* we _can_ be in RCU mode here */
|
|
error = -ENOENT;
|
|
error = -ENOENT;
|
|
- if (d_is_negative(path->dentry)) {
|
|
|
|
|
|
+ if (!inode || d_is_negative(path->dentry)) {
|
|
path_to_nameidata(path, nd);
|
|
path_to_nameidata(path, nd);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|