[CRIU] [PATCH 07/10] cgroup: always inspect the internal cgroups

Tycho Andersen tycho.andersen at canonical.com
Wed Mar 2 11:28:56 PST 2016


See comments for details.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
This one is solvable (and should be solved) by keeping track of the cgroup
namespace in the dumpinfo of the root task, but it's here for now as a
placeholder so that I can send out a working set for people to look at that
actually works. It should be safe to pick the rest of the set without this
one and I can send a revised version of this one later. I just want to get
the changes out there so people can look :)
---
 criu/cr-dump.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 4ec2a55..887c8ea 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -728,14 +728,11 @@ static int dump_task_core_all(struct parasite_ctl *ctl,
 	if (ret)
 		goto err;
 
-	/* If this is the root task and it has a cgroup ns id, it could be in
-	 * a cgroup namespace and we should try to figure out the prefix. Or,
-	 * if the task is not the parent task and its cgroup namespace differs
-	 * from its parent's, this is a nested cgns and we should compute the
-	 * prefix.
+	/* FIXME: in principle we can derive the cgns prefix from the parent's
+	 * if the nsids match, but it's not super accessible from here. For
+	 * now, we just inspect the task's cgroups from inside again.
 	 */
-	if (item->ids->has_cgroup_ns_id && (!item->parent ||
-			(item->ids->cgroup_ns_id != item->parent->ids->cgroup_ns_id))) {
+	if (item->ids->has_cgroup_ns_id) {
 		info = &cgroup_args;
 		ret = parasite_dump_cgroup(ctl, &cgroup_args);
 		if (ret)
-- 
2.7.0



More information about the CRIU mailing list