Skip to content

Commit 3f5c200

Browse files
committed
Merge tag 'cgroup-for-6.0-rc2-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull another cgroup fix from Tejun Heo: "Commit 4f7e723 ("cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock") required the cgroup core to grab cpus_read_lock() before invoking ->attach(). Unfortunately, it missed adding cpus_read_lock() in cgroup_attach_task_all(). Fix it" * tag 'cgroup-for-6.0-rc2-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all()
2 parents a86766c + 43626da commit 3f5c200

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/cgroup/cgroup-v1.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)
5959
int retval = 0;
6060

6161
mutex_lock(&cgroup_mutex);
62+
cpus_read_lock();
6263
percpu_down_write(&cgroup_threadgroup_rwsem);
6364
for_each_root(root) {
6465
struct cgroup *from_cgrp;
@@ -72,6 +73,7 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)
7273
break;
7374
}
7475
percpu_up_write(&cgroup_threadgroup_rwsem);
76+
cpus_read_unlock();
7577
mutex_unlock(&cgroup_mutex);
7678

7779
return retval;

0 commit comments

Comments
 (0)