Skip to content

Commit

Permalink
do_lookup() fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro committed Jan 16, 2011
1 parent d73b388 commit 1a8edf4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1143,6 +1144,8 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
goto need_lookup;
if (IS_ERR(dentry))
goto fail;
if (nd->flags & LOOKUP_RCU)
goto done2;
goto done;

fail:
Expand Down

0 comments on commit 1a8edf4

Please sign in to comment.