From 5fdfd7626b9cb85d7a4abd2c7f6ac78deb970997 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Fri, 5 May 2017 19:13:13 +0300 Subject: [PATCH] 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 Signed-off-by: Andrei Vagin --- criu/files.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/criu/files.c b/criu/files.c index f506c859a..a975b452e 100644 --- a/criu/files.c +++ b/criu/files.c @@ -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; }