Skip to content
Commit 243d9f3a authored by Waiman Long's avatar Waiman Long Committed by Greg Kroah-Hartman
Browse files

cgroup/cpuset: Add cpuset_can_fork() and cpuset_cancel_fork() methods

[ Upstream commit eee87853 ]

In the case of CLONE_INTO_CGROUP, not all cpusets are ready to accept
new tasks. It is too late to check that in cpuset_fork(). So we need
to add the cpuset_can_fork() and cpuset_cancel_fork() methods to
pre-check it before we can allow attachment to a different cpuset.

We also need to set the attach_in_progress flag to alert other code
that a new task is going to be added to the cpuset.

Fixes: ef2c41cf

 ("clone3: allow spawning processes into cgroups")
Suggested-by: default avatarMichal Koutný <mkoutny@suse.com>
Signed-off-by: default avatarWaiman Long <longman@redhat.com>
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e33ab283
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment