aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup/cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cgroup/cgroup.c')
-rw-r--r--kernel/cgroup/cgroup.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 8cda3bc3ae22..4bfb2908ec15 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3183,6 +3183,16 @@ static int cgroup_enable_threaded(struct cgroup *cgrp)
3183 if (cgroup_is_threaded(cgrp)) 3183 if (cgroup_is_threaded(cgrp))
3184 return 0; 3184 return 0;
3185 3185
3186 /*
3187 * If @cgroup is populated or has domain controllers enabled, it
3188 * can't be switched. While the below cgroup_can_be_thread_root()
3189 * test can catch the same conditions, that's only when @parent is
3190 * not mixable, so let's check it explicitly.
3191 */
3192 if (cgroup_is_populated(cgrp) ||
3193 cgrp->subtree_control & ~cgrp_dfl_threaded_ss_mask)
3194 return -EOPNOTSUPP;
3195
3186 /* we're joining the parent's domain, ensure its validity */ 3196 /* we're joining the parent's domain, ensure its validity */
3187 if (!cgroup_is_valid_domain(dom_cgrp) || 3197 if (!cgroup_is_valid_domain(dom_cgrp) ||
3188 !cgroup_can_be_thread_root(dom_cgrp)) 3198 !cgroup_can_be_thread_root(dom_cgrp))