The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3130

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===

From 81468ea7c0315605c637506369cb37320b981339 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Thu, 29 Aug 2019 13:56:56 +0200
Subject: [PATCH 1/2] cgroups: check for empty cgroups on freeze/unfreeze

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 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 be1fd87733..1300e24a3e 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)

From c18c6b63b8b6ba3e53734daa958b7e0182fb47c6 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Thu, 29 Aug 2019 14:05:17 +0200
Subject: [PATCH 2/2] cgroups: initialize cgroup root directory - encore

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/cgroups/cgfsng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index 1300e24a3e..a5d6c01895 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -1795,8 +1795,8 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops 
*ops,
        else if (type == LXC_AUTO_CGROUP_FULL_NOSPEC)
                type = LXC_AUTO_CGROUP_FULL_MIXED;
 
+       cgroup_root = must_make_path(root, "/sys/fs/cgroup", NULL);
        if (ops->cgroup_layout == CGROUP_LAYOUT_UNIFIED) {
-               cgroup_root = must_make_path(root, "/sys/fs/cgroup", NULL);
                if (has_cgns && wants_force_mount) {
                        /* If cgroup namespaces are supported but the container
                         * will not have CAP_SYS_ADMIN after it has started we
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to