[systemd-commits] 2 commits - src/core

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Mon Jan 5 16:12:45 PST 2015


 src/core/cgroup.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 75399049653f2d5e22032da70cf96f20d7b4d9a6
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Jan 5 19:03:08 2015 -0500

    cgroup: memory limits on / are not supported

diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index d6156c3..97f656e 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -380,7 +380,7 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
                 }
         }
 
-        if (mask & CGROUP_MEMORY) {
+        if ((mask & CGROUP_MEMORY) & !is_root) {
                 if (c->memory_limit != (uint64_t) -1) {
                         char buf[DECIMAL_STR_MAX(uint64_t) + 1];
 

commit 6da139137eb4b0ee68ca4aa4ddfdab02e8a5cf98
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Jan 5 19:03:23 2015 -0500

    cgroup: fix error message
    
    systemd[1]: Failed to set memory.limit_in_bytes on : Invalid argument

diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 3d5d889..d6156c3 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -295,6 +295,9 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
         /* Some cgroup attributes are not support on the root cgroup,
          * hence silently ignore */
         is_root = isempty(path) || path_equal(path, "/");
+        if (is_root)
+                /* Make sure we don't try to display messages with an empty path. */
+                path = "/";
 
         /* We generally ignore errors caused by read-only mounted
          * cgroup trees (assuming we are running in a container then),



More information about the systemd-commits mailing list