]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
do_lookup() fix
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 15 Jan 2011 18:12:53 +0000 (13:12 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 16 Jan 2011 01:03:39 +0000 (20:03 -0500)
do_lookup() has a path leading from LOOKUP_RCU case to non-RCU
crossing of mountpoints, which breaks things badly.  If we
hit need_revalidate: and do nothing in there, we need to come
back into LOOKUP_RCU half of things, not to done: in non-RCU
one.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 8df7a78ace58e3885adfcd824c5411da84957b73..529e917ad2fc24944efbe1749cfeee49317b15e3 100644 (file)
@@ -1089,6 +1089,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
                nd->seq = seq;
                if (dentry->d_flags & DCACHE_OP_REVALIDATE)
                        goto need_revalidate;
+done2:
                path->mnt = mnt;
                path->dentry = dentry;
                __follow_mount_rcu(nd, path, inode);
@@ -1143,6 +1144,8 @@ need_revalidate:
                goto need_lookup;
        if (IS_ERR(dentry))
                goto fail;
+       if (nd->flags & LOOKUP_RCU)
+               goto done2;
        goto done;
 
 fail: