]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/cgroup.c
cgroup: update subsystem rebind restrictions
[karo-tx-linux.git] / kernel / cgroup.c
index c66bfc8ee8a7227d0120c697a6e3ed7dede0e556..15eb2273d80b284e591b2b4e0295d9b6ee35816b 100644 (file)
@@ -1051,16 +1051,12 @@ static int rebind_subsystems(struct cgroup_root *dst_root,
                if (!(ss_mask & (1 << ssid)))
                        continue;
 
-               /* if @ss is on the dummy_root, we can always move it */
-               if (ss->root == &cgrp_dfl_root)
-                       continue;
-
-               /* if @ss has non-root cgroups attached to it, can't move */
-               if (!list_empty(&ss->root->cgrp.children))
+               /* if @ss has non-root csses attached to it, can't move */
+               if (css_next_child(NULL, cgroup_css(&ss->root->cgrp, ss)))
                        return -EBUSY;
 
                /* can't move between two non-dummy roots either */
-               if (dst_root != &cgrp_dfl_root)
+               if (ss->root != &cgrp_dfl_root && dst_root != &cgrp_dfl_root)
                        return -EBUSY;
        }