do_lookup() fix

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>
This commit is contained in:
Al Viro 2011-01-15 13:12:53 -05:00
parent d73b388459
commit 1a8edf40e7

View file

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