diff --git a/fs/namei.c b/fs/namei.c index e615ff37e27d5889c4f2662d8f552dc12101836d..768f2366bdddd5c290a559e26f54ce64c5fb5376 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1139,6 +1139,8 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, return -ECHILD; nd->seq = seq; + if (unlikely(d_need_lookup(dentry))) + goto unlazy; if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) { status = d_revalidate(dentry, nd); if (unlikely(status <= 0)) { @@ -1147,8 +1149,6 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, goto unlazy; } } - if (unlikely(d_need_lookup(dentry))) - goto unlazy; path->mnt = mnt; path->dentry = dentry; if (unlikely(!__follow_mount_rcu(nd, path, inode)))