Commit 72e50065 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Andrei Vagin

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: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 563efd3f
......@@ -1302,6 +1302,7 @@ int prepare_fds(struct pstree_item *me)
}
}
BUG_ON(current->pid->state == TASK_HELPER);
ret = open_fdinfos(me);
if (rsti(me)->fdt)
......@@ -1442,8 +1443,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;
}
......
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