Skip to content

Commit e9dcfaf

Browse files
committed
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 e3c1392 ("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()"
2 parents ca45720 + 7500c38 commit e9dcfaf

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)