summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro2011-01-15 19:12:53 +0100
committerAl Viro2011-01-16 02:03:39 +0100
commit1a8edf40e7c3eee955e0dd0316a7c9d85e36f597 (patch)
treee9776058ac678d6f8b29429e77d2de58dcc83608 /fs/namei.c
parentMerge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jb... (diff)
downloadkernel-qcow2-linux-1a8edf40e7c3eee955e0dd0316a7c9d85e36f597.tar.gz
kernel-qcow2-linux-1a8edf40e7c3eee955e0dd0316a7c9d85e36f597.tar.xz
kernel-qcow2-linux-1a8edf40e7c3eee955e0dd0316a7c9d85e36f597.zip
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>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 8df7a78ace58..529e917ad2fc 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -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: