From 81468ea7c0315605c637506369cb37320b981339 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 29 Aug 2019 13:56:56 +0200 Subject: [PATCH] cgroups: check for empty cgroups on freeze/unfreeze Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index be1fd8773..1300e24a3 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2003,6 +2003,9 @@ __cgfsng_ops static bool cgfsng_freeze(struct cgroup_ops *ops) __do_fclose FILE *f = NULL; struct hierarchy *h; + if (!ops->hierarchies) + return true; + if (ops->cgroup_layout != CGROUP_LAYOUT_UNIFIED) { h = get_hierarchy(ops, "freezer"); if (!h) @@ -2054,6 +2057,9 @@ __cgfsng_ops static bool cgfsng_unfreeze(struct cgroup_ops *ops) __do_free char *fullpath = NULL; struct hierarchy *h; + if (!ops->hierarchies) + return true; + if (ops->cgroup_layout != CGROUP_LAYOUT_UNIFIED) { h = get_hierarchy(ops, "freezer"); if (!h) -- 2.47.2