namespace_unlock();
 }
 
-bool has_locked_children(struct mount *mnt, struct dentry *dentry)
+static bool __has_locked_children(struct mount *mnt, struct dentry *dentry)
 {
        struct mount *child;
 
        return false;
 }
 
+bool has_locked_children(struct mount *mnt, struct dentry *dentry)
+{
+       bool res;
+
+       read_seqlock_excl(&mount_lock);
+       res = __has_locked_children(mnt, dentry);
+       read_sequnlock_excl(&mount_lock);
+       return res;
+}
+
 /*
  * Check that there aren't references to earlier/same mount namespaces in the
  * specified subtree.  Such references can act as pins for mount namespaces
                        return ERR_PTR(-EINVAL);
        }
 
-       if (has_locked_children(old_mnt, path->dentry))
+       if (__has_locked_children(old_mnt, path->dentry))
                return ERR_PTR(-EINVAL);
 
        new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
        if (!may_copy_tree(old_path))
                return mnt;
 
-       if (!recurse && has_locked_children(old, old_path->dentry))
+       if (!recurse && __has_locked_children(old, old_path->dentry))
                return mnt;
 
        if (recurse)
                goto out;
 
        /* From mount should not have locked children in place of To's root */
-       if (has_locked_children(from, to->mnt.mnt_root))
+       if (__has_locked_children(from, to->mnt.mnt_root))
                goto out;
 
        /* Setting sharing groups is only allowed on private mounts */