summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-05-27 07:03:15 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-05-27 07:03:15 -0400
commitd6e9bd256c88ce5f4b668249e363a74f51393daa (patch)
tree87c70fb00c36164136fbdc0eb2daf3dbe79c80b1 /fs
parentdea3937619cb67d2ad08e2d29ae923875b1eeee9 (diff)
downloadlinux-3.10-d6e9bd256c88ce5f4b668249e363a74f51393daa.tar.gz
linux-3.10-d6e9bd256c88ce5f4b668249e363a74f51393daa.tar.bz2
linux-3.10-d6e9bd256c88ce5f4b668249e363a74f51393daa.zip
Lift the check for automount points into do_lookup()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 98808142409..1ab641f2e78 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -945,9 +945,6 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
path->dentry = mounted->mnt_root;
nd->seq = read_seqcount_begin(&path->dentry->d_seq);
}
-
- if (unlikely(path->dentry->d_flags & DCACHE_NEED_AUTOMOUNT))
- return false;
return true;
}
@@ -1164,8 +1161,11 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
}
path->mnt = mnt;
path->dentry = dentry;
- if (likely(__follow_mount_rcu(nd, path, inode)))
- return 0;
+ if (unlikely(!__follow_mount_rcu(nd, path, inode)))
+ goto unlazy;
+ if (unlikely(path->dentry->d_flags & DCACHE_NEED_AUTOMOUNT))
+ goto unlazy;
+ return 0;
unlazy:
if (unlazy_walk(nd, dentry))
return -ECHILD;