diff --git a/fs/namei.c b/fs/namei.c index c7fac83c9a85..eac0ec35be37 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2037,11 +2037,11 @@ static noinline const char *pick_link(struct nameidata *nd, struct path *link, unlikely(link->mnt->mnt_flags & MNT_NOSYMFOLLOW)) return ERR_PTR(-ELOOP); + if (nd->flags & LOOKUP_RCU) { + if (!try_to_unlazy(nd)) + return ERR_PTR(-ECHILD); + } if (unlikely(atime_needs_update(&last->link, inode))) { - if (nd->flags & LOOKUP_RCU) { - if (!try_to_unlazy(nd)) - return ERR_PTR(-ECHILD); - } touch_atime(&last->link); cond_resched(); }