]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: check for empty cgroups on freeze/unfreeze
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 29 Aug 2019 11:56:56 +0000 (13:56 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 29 Aug 2019 11:56:56 +0000 (13:56 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index be1fd87733135dd4806c26d31ec199f165f79712..1300e24a3ea79e3465ae5a5bee7c2f1a1579f12f 100644 (file)
@@ -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)