• Tejun Heo's avatar
    cgroup: fix offlining child waiting in cgroup_subtree_control_write() · 0cee8b77
    Tejun Heo authored
    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: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarLi Zefan <lizefan@huawei.com>
    0cee8b77
cgroup.c 145 KB