summaryrefslogtreecommitdiff
path: root/kernel/cgroup/cgroup-v1.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2022-08-26 11:13:39 -1000
committerTejun Heo <tj@kernel.org>2022-08-26 11:13:39 -1000
commit265efc941fbb5c4478d0466fbb2186bf6d57a9be (patch)
treeb6e02ec02b16b8a296636e814256c10c639e45eb /kernel/cgroup/cgroup-v1.c
parentfa7e439cf90ba23ea473d0b7d85efd02ae6ccf94 (diff)
parent43626dade36fa74d3329046f4ae2d7fdefe401c6 (diff)
Merge branch 'for-6.0-fixes' into for-6.1
Pulling to receive 43626dade36f ("group: Add missing cpus_read_lock() to cgroup_attach_task_all()") for a follow-up patch.
Diffstat (limited to 'kernel/cgroup/cgroup-v1.c')
-rw-r--r--kernel/cgroup/cgroup-v1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index 2ade21b54dc4..ff6a8099eb2a 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -59,6 +59,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)
int retval = 0;
mutex_lock(&cgroup_mutex);
+ cpus_read_lock();
percpu_down_write(&cgroup_threadgroup_rwsem);
for_each_root(root) {
struct cgroup *from_cgrp;
@@ -72,6 +73,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)
break;
}
percpu_up_write(&cgroup_threadgroup_rwsem);
+ cpus_read_unlock();
mutex_unlock(&cgroup_mutex);
return retval;