aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-31 08:19:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-31 08:19:39 -0400
commite9dcfaff0105045d6bbacb7620ee13f1976ecf07 (patch)
tree226df86064dc8dd5b51ca03ce1ade33cfec682ea
parentca4572042e41a1aed2139ef66b0427c1f8d10179 (diff)
parent7500c38ac3258815f86f41744a538850c3221b23 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fix from Al Viro. Automount handling was broken by commit e3c13928086f ("namei: massage lookup_slow() to be usable by lookup_one_len_unlocked()") moving the test for negative dentry too early. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix the braino in "namei: massage lookup_slow() to be usable by lookup_one_len_unlocked()"
-rw-r--r--fs/namei.c10
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 }