]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
limit-util: quieten a very common debug message that is misleading
authorLennart Poettering <lennart@poettering.net>
Thu, 14 May 2020 17:11:18 +0000 (19:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 15 May 2020 13:50:09 +0000 (15:50 +0200)
src/basic/limits-util.c

index 43f6b6f68a96d640120ec65f235b94725f4230a1..9da767a5706f11135cb042d8be6fe3f70cf07278 100644 (file)
@@ -41,6 +41,11 @@ uint64_t physical_memory(void) {
         }
         if (r > 0) {
                 r = cg_get_attribute("memory", root, "memory.max", &value);
+                if (r == -ENOENT) /* Field does not exist on the system's top-level cgroup, hence don't
+                                   * complain. (Note that it might exist on our own root though, if we live
+                                   * in a cgroup namespace, hence check anyway instead of not even
+                                   * trying.) */
+                        return mem;
                 if (r < 0) {
                         log_debug_errno(r, "Failed to read memory.max cgroup attribute, ignoring cgroup memory limit: %m");
                         return mem;