aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-03-26 06:54:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-31 16:03:16 -0400
commitfa4ee159512ee39b6c65ac40db986ea7a2f7de60 (patch)
tree1a245fe312d79e063de819f4da0debc2b13739d7 /fs/namei.c
parent4613ad180d19082f99551477dcb13cb23d23661b (diff)
vfs: fix d_need_lookup/d_revalidate order in do_lookup
Doing revalidate on a dentry which has not yet been looked up makes no sense. Move the d_need_lookup() check before d_revalidate(). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index e615ff37e27d..768f2366bddd 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1139,6 +1139,8 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
1139 return -ECHILD; 1139 return -ECHILD;
1140 nd->seq = seq; 1140 nd->seq = seq;
1141 1141
1142 if (unlikely(d_need_lookup(dentry)))
1143 goto unlazy;
1142 if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) { 1144 if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
1143 status = d_revalidate(dentry, nd); 1145 status = d_revalidate(dentry, nd);
1144 if (unlikely(status <= 0)) { 1146 if (unlikely(status <= 0)) {
@@ -1147,8 +1149,6 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
1147 goto unlazy; 1149 goto unlazy;
1148 } 1150 }
1149 } 1151 }
1150 if (unlikely(d_need_lookup(dentry)))
1151 goto unlazy;
1152 path->mnt = mnt; 1152 path->mnt = mnt;
1153 path->dentry = dentry; 1153 path->dentry = dentry;
1154 if (unlikely(!__follow_mount_rcu(nd, path, inode))) 1154 if (unlikely(!__follow_mount_rcu(nd, path, inode)))