From: Christian Brauner Date: Thu, 29 Aug 2019 11:56:56 +0000 (+0200) Subject: cgroups: check for empty cgroups on freeze/unfreeze X-Git-Tag: lxc-4.0.0~122^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81468ea7c0315605c637506369cb37320b981339;p=thirdparty%2Flxc.git cgroups: check for empty cgroups on freeze/unfreeze Signed-off-by: Christian Brauner --- 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)