Skip to content

Commit

Permalink
fix the braino in "namei: massage lookup_slow() to be usable by looku…
Browse files Browse the repository at this point in the history
…p_one_len_unlocked()"

We should try to trigger automount *before* bailing out on negative dentry.

Reported-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Reported-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Reported-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Mar 31, 2016
1 parent f55532a commit 7500c38
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7500c38

Please sign in to comment.