mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-24 10:38:06 +00:00
cgroup: make prepare_task_cgroup lookup current cgset in ancestors
In case if our parent is a dead task (zombie) or a helper which in it's turn has zombie parent, and parent thus has zero cg_set we should look for current cgset deeper. Fixes: #1066 Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
parent
0f3d578df3
commit
45d43fcee1
1 changed files with 7 additions and 2 deletions
|
|
@ -1210,14 +1210,19 @@ static int move_in_cgroup(CgSetEntry *se, bool setup_cgns)
|
|||
|
||||
int prepare_task_cgroup(struct pstree_item *me)
|
||||
{
|
||||
struct pstree_item *parent = me->parent;
|
||||
CgSetEntry *se;
|
||||
u32 current_cgset;
|
||||
|
||||
if (!rsti(me)->cg_set)
|
||||
return 0;
|
||||
|
||||
if (me->parent)
|
||||
current_cgset = rsti(me->parent)->cg_set;
|
||||
/* Zombies and helpers can have cg_set == 0 so we skip them */
|
||||
while (parent && !rsti(parent)->cg_set)
|
||||
parent = parent->parent;
|
||||
|
||||
if (parent)
|
||||
current_cgset = rsti(parent)->cg_set;
|
||||
else
|
||||
current_cgset = root_cg_set;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue