diff --git a/fs/namei.c b/fs/namei.c
index 1004966437f92997d023cb1f96697c2d67b165c5..c0c78e193e2ac4a5c3d06a539fe3dac748be50c3 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1557,7 +1557,8 @@ static inline int walk_component(struct nameidata *nd, struct path *path,
 
 	if (should_follow_link(inode, follow)) {
 		if (nd->flags & LOOKUP_RCU) {
-			if (unlikely(unlazy_walk(nd, path->dentry))) {
+			if (unlikely(nd->path.mnt != path->mnt ||
+				     unlazy_walk(nd, path->dentry))) {
 				err = -ECHILD;
 				goto out_err;
 			}
@@ -3023,7 +3024,8 @@ static int do_last(struct nameidata *nd, struct path *path,
 
 	if (should_follow_link(inode, !symlink_ok)) {
 		if (nd->flags & LOOKUP_RCU) {
-			if (unlikely(unlazy_walk(nd, path->dentry))) {
+			if (unlikely(nd->path.mnt != path->mnt ||
+				     unlazy_walk(nd, path->dentry))) {
 				error = -ECHILD;
 				goto out;
 			}