From 1123e17b16f1f2048dc581ae8da2c4943ad4c45d Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 18 Oct 2012 17:40:30 -0700 Subject: [PATCH] --- yaml --- r: 334800 b: refs/heads/master c: d87838321124061f6c935069d97f37010fa417e6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/cgroup.c | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index a9ba5db0be6b..212701a256cb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9bb71308b8133d643648776243e4d5599b1c193d +refs/heads/master: d87838321124061f6c935069d97f37010fa417e6 diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index 75aec12c78a0..f24f724620dd 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -4883,19 +4883,10 @@ void cgroup_post_fork(struct task_struct *child) */ if (use_task_css_set_links) { write_lock(&css_set_lock); - if (list_empty(&child->cg_list)) { - /* - * It's safe to use child->cgroups without task_lock() - * here because we are protected through - * threadgroup_change_begin() against concurrent - * css_set change in cgroup_task_migrate(). Also - * the task can't exit at that point until - * wake_up_new_task() is called, so we are protected - * against cgroup_exit() setting child->cgroup to - * init_css_set. - */ + task_lock(child); + if (list_empty(&child->cg_list)) list_add(&child->cg_list, &child->cgroups->tasks); - } + task_unlock(child); write_unlock(&css_set_lock); } }