diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-31 14:19:39 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-31 14:19:39 +0200 |
commit | e9dcfaff0105045d6bbacb7620ee13f1976ecf07 (patch) | |
tree | 226df86064dc8dd5b51ca03ce1ade33cfec682ea /fs | |
parent | Merge tag 'gpio-v4.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linu... (diff) | |
parent | fix the braino in "namei: massage lookup_slow() to be usable by lookup_one_le... (diff) | |
download | linux-e9dcfaff0105045d6bbacb7620ee13f1976ecf07.tar.xz linux-e9dcfaff0105045d6bbacb7620ee13f1976ecf07.zip |
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()"
Diffstat (limited to 'fs')
-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) nd->flags); if (IS_ERR(path.dentry)) return PTR_ERR(path.dentry); - if (unlikely(d_is_negative(path.dentry))) { - dput(path.dentry); - return -ENOENT; - } + path.mnt = nd->path.mnt; err = follow_managed(&path, nd); if (unlikely(err < 0)) return err; + if (unlikely(d_is_negative(path.dentry))) { + path_to_nameidata(&path, nd); + return -ENOENT; + } + seq = 0; /* we are already out of RCU mode */ inode = d_backing_inode(path.dentry); } |