From 898335ba320fc24ed6c99c331ee61daa48620e13 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Mon, 21 Apr 2014 18:23:17 +0400 Subject: [PATCH] mounts: Make sure all namespaces has the same root source Currently we support nested mount namespaces, only if all of them have the same path to the root. crtools doesn't mount root, so it should be bind-mounted for all namespaces. Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- mount.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mount.c b/mount.c index abfbcaf66..e876e2529 100644 --- a/mount.c +++ b/mount.c @@ -233,6 +233,12 @@ static struct mount_info *mnt_build_ids_tree(struct mount_info *list) m->mnt_id, m->parent_mnt_id, m->mountpoint, root ? "found" : "not found"); if (root && m->is_ns_root) { + if (!mounts_equal(root, m, true) || + strcmp(root->root, m->root)) { + pr_err("Nested mount namespaces with different roots are not supported yet"); + return NULL; + } + /* * A root of a sub mount namespace is * mounted in a temporary directory in the