Skip to content

Commit 7500c38

Browse files
author
Al Viro
committed
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 <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>
1 parent f55532a commit 7500c38

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/namei.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,15 +1740,17 @@ static int walk_component(struct nameidata *nd, int flags)
17401740
nd->flags);
17411741
if (IS_ERR(path.dentry))
17421742
return PTR_ERR(path.dentry);
1743-
if (unlikely(d_is_negative(path.dentry))) {
1744-
dput(path.dentry);
1745-
return -ENOENT;
1746-
}
1743+
17471744
path.mnt = nd->path.mnt;
17481745
err = follow_managed(&path, nd);
17491746
if (unlikely(err < 0))
17501747
return err;
17511748

1749+
if (unlikely(d_is_negative(path.dentry))) {
1750+
path_to_nameidata(&path, nd);
1751+
return -ENOENT;
1752+
}
1753+
17521754
seq = 0; /* we are already out of RCU mode */
17531755
inode = d_backing_inode(path.dentry);
17541756
}

0 commit comments

Comments
 (0)