]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: never migrate kernel threads out of the root cgroup
authorLennart Poettering <lennart@poettering.net>
Tue, 1 Sep 2015 15:53:14 +0000 (17:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Sep 2015 16:37:01 +0000 (18:37 +0200)
It won't work anyway.

src/basic/cgroup-util.c

index 6b3162a35fc0b6e5cc089e75f2fc9d30b4622ddb..2a6dc2769b4c3e0817101c6b98a226c898670245 100644 (file)
@@ -321,6 +321,14 @@ int cg_migrate(const char *cfrom, const char *pfrom, const char *cto, const char
                         if (set_get(s, LONG_TO_PTR(pid)) == LONG_TO_PTR(pid))
                                 continue;
 
+                        /* Ignore kernel threads. Since they can only
+                         * exist in the root cgroup, we only check for
+                         * them there. */
+                        if (cfrom &&
+                            (isempty(pfrom) || path_equal(pfrom, "/")) &&
+                            is_kernel_thread(pid) > 0)
+                                continue;
+
                         r = cg_attach(cto, pto, pid);
                         if (r < 0) {
                                 if (ret >= 0 && r != -ESRCH)