]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: fix offlining child waiting in cgroup_subtree_control_write()
authorTejun Heo <tj@kernel.org>
Tue, 13 May 2014 16:10:59 +0000 (12:10 -0400)
committerTejun Heo <tj@kernel.org>
Tue, 13 May 2014 16:10:59 +0000 (12:10 -0400)
commitf5d83b122e9ab0a1c5e26b07255d03bab08ab168
treeef6db71c2426ce12ed2f558790d0efe76bffd4a7
parent7d5d6ec8742eac29bcc1c4ca71dee56d9f8f09c0
cgroup: fix offlining child waiting in cgroup_subtree_control_write()

cgroup_subtree_control_write() waits for offline to complete
child-by-child before enabling a controller; however, it has a couple
bugs.

* It doesn't initialize the wait_queue_t.  This can lead to infinite
  hang on the following schedule() among other things.

* It forgets to pin the child before releasing cgroup_tree_mutex and
  performing schedule().  The child may already be gone by the time it
  wakes up and invokes finish_wait().  Pin the child being waited on.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
kernel/cgroup.c