cgroup: fix --manage-cgroups=ignore

Using '--manage-cgroups=ignore' fails during restore. This fixes the use
of '--manage-cgroups=ignore'.

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber 2022-04-02 15:57:54 +00:00 committed by Andrei Vagin
parent c71d4a54a3
commit 2b6901707c

View file

@ -1217,6 +1217,9 @@ int prepare_task_cgroup(struct pstree_item *me)
CgSetEntry *se;
u32 current_cgset;
if (opts.manage_cgroups == CG_MODE_IGNORE)
return 0;
if (!rsti(me)->cg_set)
return 0;
@ -1299,6 +1302,9 @@ static int restore_cgroup_prop(const CgroupPropEntry *cg_prop_entry_p, char *pat
int cg, fd, ret = -1;
CgroupPerms *perms = cg_prop_entry_p->perms;
if (opts.manage_cgroups == CG_MODE_IGNORE)
return 0;
if (!cg_prop_entry_p->value) {
pr_err("cg_prop_entry->value was empty when should have had a value\n");
return -1;