From: Al Viro Date: Thu, 31 Mar 2016 04:23:05 +0000 (-0400) Subject: fix the braino in "namei: massage lookup_slow() to be usable by lookup_one_len_unlock... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7500c38a;p=linux-beck.git fix the braino in "namei: massage lookup_slow() to be usable by lookup_one_len_unlocked()" We should try to trigger automount *before* bailing out on negative dentry. Reported-by: Jun'ichi Nomura Reported-by: Jun'ichi Nomura Reported-by: Arend van Spriel Tested-by: Arend van Spriel Tested-by: Jun'ichi Nomura Signed-off-by: Al Viro --- 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); }