]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: add comment explaining why we ignore EINVAL at two places
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Nov 2018 19:14:59 +0000 (20:14 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Nov 2018 11:24:37 +0000 (12:24 +0100)
These are just copies from further down.

src/core/cgroup.c

index 01ce8902478392940931a78b656c7b26a262500b..da677b8f222d71e7c7a1c41a9793888eac9c987c 100644 (file)
@@ -431,6 +431,8 @@ static int whitelist_device(BPFProgram *prog, const char *path, const char *node
                         major(st.st_rdev), minor(st.st_rdev),
                         acc);
 
+                /* Changing the devices list of a populated cgroup might result in EINVAL, hence ignore EINVAL here. */
+
                 r = cg_set_attribute("devices", path, "devices.allow", buf);
                 if (r < 0)
                         return log_full_errno(IN_SET(r, -ENOENT, -EROFS, -EINVAL, -EACCES) ? LOG_DEBUG : LOG_WARNING,
@@ -517,6 +519,9 @@ static int whitelist_major(BPFProgram *prog, const char *path, const char *name,
                                 maj,
                                 acc);
 
+                        /* Changing the devices list of a populated cgroup might result in EINVAL, hence ignore EINVAL
+                         * here. */
+
                         r = cg_set_attribute("devices", path, "devices.allow", buf);
                         if (r < 0)
                                 log_full_errno(IN_SET(r, -ENOENT, -EROFS, -EINVAL, -EACCES) ? LOG_DEBUG : LOG_WARNING,
@@ -1052,8 +1057,7 @@ static void cgroup_context_apply(
                         if (r < 0)
                                 log_unit_warning_errno(u, r, "Failed to initialize device control bpf program: %m");
                 } else {
-                        /* Changing the devices list of a populated cgroup
-                         * might result in EINVAL, hence ignore EINVAL
+                        /* Changing the devices list of a populated cgroup might result in EINVAL, hence ignore EINVAL
                          * here. */
 
                         if (c->device_allow || c->device_policy != CGROUP_AUTO)