Commit 6045ca0e authored by Pavel Emelyanov's avatar Pavel Emelyanov

rst: Cehck for objects sharing before attaching helpers to tree

Helpers don't have any IDs on board and thus checks for "is
my X shared with parent" will be wrong.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7ee4c484
......@@ -436,6 +436,13 @@ static int prepare_pstree_ids(void)
helper->pid.virt, helper->pgid);
}
return 0;
}
static int prepare_pstree_kobj_ids(void)
{
struct pstree_item *item;
/* Find a process with minimal pid for shared fd tables */
for_each_pstree_item(item) {
struct pstree_item *parent = item->parent;
......@@ -487,6 +494,12 @@ int prepare_pstree(void)
* shell, not from image. Set things up for this.
*/
ret = prepare_pstree_for_shell_job();
if (!ret)
/*
* Walk the collected tree and prepare for restoring
* of shared objects at clone time
*/
ret = prepare_pstree_kobj_ids();
if (!ret)
/*
* Session/Group leaders might be dead. Need to fix
......
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