2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

files: Make possible task helpers to use shared_fdt_prepare()

Next patches will create transport sockets in task helpers.
As helpers are forked using CLONE_FILES, they must resolve
shared fds to create their own service fds. This patch allows
that.

I've digged in the code, and there is no a reason, we need
pid_rst_prio() during choosing of fdt restorer. So, this
case may be safely deleted, which guarantees, that in case
of TASK_HELPER, the restorer of fdt will be parent, i.e.,
no one TASK_HELPER will be restorer of fdt.

v5: New

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Kirill Tkhai 2017-05-05 19:13:13 +03:00 committed by Andrei Vagin
parent 61a38fba15
commit 5fdfd7626b

View File

@ -1291,6 +1291,7 @@ int prepare_fds(struct pstree_item *me)
}
}
BUG_ON(current->pid->state == TASK_HELPER);
ret = open_fdinfos(me);
if (rsti(me)->fdt)
@ -1430,8 +1431,6 @@ int shared_fdt_prepare(struct pstree_item *item)
rsti(item)->fdt = fdt;
rsti(item)->service_fd_id = fdt->nr;
fdt->nr++;
if (pid_rst_prio(vpid(item), fdt->pid))
fdt->pid = vpid(item);
return 0;
}