From: Rom Lemarchand Date: Wed, 27 May 2015 00:00:44 +0000 (-0700) Subject: cgroup: Fix issues in allow_attach callback X-Git-Tag: firefly_0821_release~2958^2~165 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0d6687a82af23846e8aa6786bcc672ca16b0a5c6;p=firefly-linux-kernel-4.4.55.git cgroup: Fix issues in allow_attach callback - Return -EINVAL when cgroups support isn't enabled - Add allow_attach callback in CPU cgroups Change-Id: Id3360b4a39919524fc4b6fcbd44fa2050009f000 Signed-off-by: Rom Lemarchand --- diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c08c83182e08..5c30867511cf 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -566,7 +566,7 @@ static inline int cgroup_init(void) { return 0; } static inline int subsys_cgroup_allow_attach(struct cgroup_subsys_state *css, struct cgroup_taskset *tset) { - return 0; + return -EINVAL; } #endif /* !CONFIG_CGROUPS */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 67359c7f35db..61b0914cc7aa 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8609,6 +8609,7 @@ struct cgroup_subsys cpu_cgrp_subsys = { .fork = cpu_cgroup_fork, .can_attach = cpu_cgroup_can_attach, .attach = cpu_cgroup_attach, + .allow_attach = subsys_cgroup_allow_attach, .legacy_cftypes = cpu_files, .early_init = 1, };