diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 794f81dce766..1d9ca2d5dff6 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1740,15 +1740,17 @@ static int walk_component(struct nameidata *nd, int flags) | |||
1740 | nd->flags); | 1740 | nd->flags); |
1741 | if (IS_ERR(path.dentry)) | 1741 | if (IS_ERR(path.dentry)) |
1742 | return PTR_ERR(path.dentry); | 1742 | return PTR_ERR(path.dentry); |
1743 | if (unlikely(d_is_negative(path.dentry))) { | 1743 | |
1744 | dput(path.dentry); | ||
1745 | return -ENOENT; | ||
1746 | } | ||
1747 | path.mnt = nd->path.mnt; | 1744 | path.mnt = nd->path.mnt; |
1748 | err = follow_managed(&path, nd); | 1745 | err = follow_managed(&path, nd); |
1749 | if (unlikely(err < 0)) | 1746 | if (unlikely(err < 0)) |
1750 | return err; | 1747 | return err; |
1751 | 1748 | ||
1749 | if (unlikely(d_is_negative(path.dentry))) { | ||
1750 | path_to_nameidata(&path, nd); | ||
1751 | return -ENOENT; | ||
1752 | } | ||
1753 | |||
1752 | seq = 0; /* we are already out of RCU mode */ | 1754 | seq = 0; /* we are already out of RCU mode */ |
1753 | inode = d_backing_inode(path.dentry); | 1755 | inode = d_backing_inode(path.dentry); |
1754 | } | 1756 | } |