Skip to content

Commit

Permalink
cgroups: check for empty cgroups on freeze/unfreeze
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Aug 29, 2019
1 parent 8ba5849 commit 81468ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 81468ea

Please sign in to comment.