[systemd-commits] 6 commits - TODO src/core src/random-seed

Lennart Poettering lennart at kemper.freedesktop.org
Fri Sep 13 05:36:36 PDT 2013


 TODO                          |    4 ++++
 src/core/automount.c          |    6 +++---
 src/core/cgroup.c             |   17 ++++++++++++-----
 src/random-seed/random-seed.c |    2 +-
 4 files changed, 20 insertions(+), 9 deletions(-)

New commits:
commit df5f6971e6e15b4632884916c71daa076c8bae96
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Sep 13 14:28:17 2013 +0200

    update TODO

diff --git a/TODO b/TODO
index 5354692..9943b3e 100644
--- a/TODO
+++ b/TODO
@@ -60,6 +60,10 @@ Features:
 
 * Move backlight and random-seed into /var/lib/systemd
 
+* If we try to find a unit via a danglign symlink generate a clean
+  error. Currently we just ignore it and read the unit from the search
+  path anyway.
+
 * When a Type=forking service fails and needed another service that
   service is not cleaned up again when it has StopWhenUnneeded=yes
   http://lists.freedesktop.org/archives/systemd-devel/2013-July/012141.html

commit 2dba165c63cc1b687bb9f035a8f01f40595a708a
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Fri Sep 13 14:12:55 2013 +0200

    random-seed: we should return errno of failed loop_write

diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c
index 4776c07..afbd500 100644
--- a/src/random-seed/random-seed.c
+++ b/src/random-seed/random-seed.c
@@ -157,7 +157,7 @@ int main(int argc, char *argv[]) {
                 r = loop_write(seed_fd, buf, (size_t) k, false);
                 if (r <= 0) {
                         log_error("Failed to write new random seed file: %s", r < 0 ? strerror(-r) : "short write");
-                        r = k == 0 ? -EIO : (int) k;
+                        r = r == 0 ? -EIO : r;
                 }
         }
 

commit 6a94f2e938c6535917b29a9611d6ad815125ed1b
Author: Gao feng <gaofeng at cn.fujitsu.com>
Date:   Fri Sep 13 14:43:04 2013 +0800

    cgroup: fix incorrectly setting memory cgroup
    
    If the memory_limit of unit is -1, we should write "-1"
    to the file memory.limit_in_bytes. not the (unit64_t) -1.
    
    otherwise the memory.limit_in_bytes will be set to zero.

diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index aee93ba..244baff 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -257,14 +257,21 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
 
         if (mask & CGROUP_MEMORY) {
                 char buf[DECIMAL_STR_MAX(uint64_t) + 1];
+                if (c->memory_limit != (uint64_t) -1) {
+                        sprintf(buf, "%" PRIu64 "\n", c->memory_limit);
+                        r = cg_set_attribute("memory", path, "memory.limit_in_bytes", buf);
+                } else
+                        r = cg_set_attribute("memory", path, "memory.limit_in_bytes", "-1");
 
-                sprintf(buf, "%" PRIu64 "\n", c->memory_limit);
-                r = cg_set_attribute("memory", path, "memory.limit_in_bytes", buf);
                 if (r < 0)
                         log_error("Failed to set memory.limit_in_bytes on %s: %s", path, strerror(-r));
 
-                sprintf(buf, "%" PRIu64 "\n", c->memory_soft_limit);
-                r = cg_set_attribute("memory", path, "memory.soft_limit_in_bytes", buf);
+                if (c->memory_soft_limit != (uint64_t) -1) {
+                        sprintf(buf, "%" PRIu64 "\n", c->memory_soft_limit);
+                        r = cg_set_attribute("memory", path, "memory.soft_limit_in_bytes", buf);
+                } else
+                        r = cg_set_attribute("memory", path, "memory.soft_limit_in_bytes", "-1");
+
                 if (r < 0)
                         log_error("Failed to set memory.soft_limit_in_bytes on %s: %s", path, strerror(-r));
         }

commit 84121bc2ee2b1af811a50bc6974115aba603c806
Author: Gao feng <gaofeng at cn.fujitsu.com>
Date:   Fri Sep 13 11:17:06 2013 +0800

    cgroup: correct the log information
    
    it should be memory.soft_limit_in_bytes.

diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index fba0b2f..aee93ba 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -266,7 +266,7 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
                 sprintf(buf, "%" PRIu64 "\n", c->memory_soft_limit);
                 r = cg_set_attribute("memory", path, "memory.soft_limit_in_bytes", buf);
                 if (r < 0)
-                        log_error("Failed to set memory.limit_in_bytes on %s: %s", path, strerror(-r));
+                        log_error("Failed to set memory.soft_limit_in_bytes on %s: %s", path, strerror(-r));
         }
 
         if (mask & CGROUP_DEVICE) {

commit 15b4a7548f2e8f4e5dc0504b1c549edb0c7e0956
Author: Gao feng <gaofeng at cn.fujitsu.com>
Date:   Fri Sep 13 11:17:05 2013 +0800

    cgroup: add the missing setting of variable's value
    
    set the value of variable "r" to the return value
    of cg_set_attribute.

diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 3eeb475..fba0b2f 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -264,7 +264,7 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
                         log_error("Failed to set memory.limit_in_bytes on %s: %s", path, strerror(-r));
 
                 sprintf(buf, "%" PRIu64 "\n", c->memory_soft_limit);
-                cg_set_attribute("memory", path, "memory.soft_limit_in_bytes", buf);
+                r = cg_set_attribute("memory", path, "memory.soft_limit_in_bytes", buf);
                 if (r < 0)
                         log_error("Failed to set memory.limit_in_bytes on %s: %s", path, strerror(-r));
         }

commit a5e41bdb72a15c34971469535b4c3da16f0cce55
Author: David Mackey <tdmackey at booleanhaiku.com>
Date:   Thu Sep 12 19:45:49 2013 -0700

    automount: rename repeat_unmont to repeat_unmount
    
    Trivial cleanup of repeat_unmount() spelling.

diff --git a/src/core/automount.c b/src/core/automount.c
index a20d534..6762392 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -66,7 +66,7 @@ static void automount_init(Unit *u) {
         UNIT(a)->ignore_on_isolate = true;
 }
 
-static void repeat_unmout(const char *path) {
+static void repeat_unmount(const char *path) {
         assert(path);
 
         for (;;) {
@@ -100,7 +100,7 @@ static void unmount_autofs(Automount *a) {
         if (a->where &&
             (UNIT(a)->manager->exit_code != MANAGER_RELOAD &&
              UNIT(a)->manager->exit_code != MANAGER_REEXECUTE))
-                repeat_unmout(a->where);
+                repeat_unmount(a->where);
 }
 
 static void automount_done(Unit *u) {
@@ -575,7 +575,7 @@ fail:
                 close_nointr_nofail(ioctl_fd);
 
         if (mounted)
-                repeat_unmout(a->where);
+                repeat_unmount(a->where);
 
         log_error_unit(UNIT(a)->id,
                        "Failed to initialize automounter: %s", strerror(-r));



More information about the systemd-commits mailing list