Commit a24e37d6 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

cgroup: don't do cgroup moves async

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: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 5057dc5e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment