[CRIU] [PATCH 05/10] cgroup: don't do cgroup moves async

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


We rely on the synchronous-ness of the behavior because we assume that the
task is in all the right cgroups when forking its children. If it's not,
and the child has the same cgroups as its parent but not all the moves are
done, it might end up in /.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 criu/cgroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/criu/cgroup.c b/criu/cgroup.c
index 887b4b8..cf005d9 100644
--- a/criu/cgroup.c
+++ b/criu/cgroup.c
@@ -1041,7 +1041,7 @@ static int move_in_cgroup(CgSetEntry *se)
 			pr_info("setting cgns prefix to %s\n", ce->path);
 			snprintf(aux + aux_off, sizeof(aux) - aux_off, "/%s/tasks", ce->path);
 			ce->path[ce->cgns_prefix] = tmp;
-			if (userns_call(userns_move, UNS_ASYNC, aux, strlen(aux) + 1, -1) < 0) {
+			if (userns_call(userns_move, 0, aux, strlen(aux) + 1, -1) < 0) {
 				pr_perror("couldn't set cgns prefix %s", aux);
 				return -1;
 			}
@@ -1060,7 +1060,7 @@ static int move_in_cgroup(CgSetEntry *se)
 		 */
 		snprintf(aux + aux_off, sizeof(aux) - aux_off, "/%s/tasks", ce->path);
 		pr_debug("  `-> %s\n", aux);
-		err = userns_call(userns_move, UNS_ASYNC, aux, strlen(aux) + 1, -1);
+		err = userns_call(userns_move, 0, aux, strlen(aux) + 1, -1);
 		if (err < 0) {
 			pr_perror("Can't move into %s (%d/%d)", aux, err, fd);
 			return -1;
-- 
2.7.0



More information about the CRIU mailing list