X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fcgroup_freezer.c;h=59e9ef6aab4002e1d99170f50156e733e8f46343;hb=be367d09927023d081f9199665c8500f69f14d22;hp=fb249e2bcada880a19105488c7fdde33e9483126;hpb=ae20a6afec1cf21919d97303f2d8b737eac5acc7;p=deliverable%2Flinux.git diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index fb249e2bcada..59e9ef6aab40 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c @@ -159,7 +159,7 @@ static bool is_task_frozen_enough(struct task_struct *task) */ static int freezer_can_attach(struct cgroup_subsys *ss, struct cgroup *new_cgroup, - struct task_struct *task) + struct task_struct *task, bool threadgroup) { struct freezer *freezer; @@ -177,6 +177,19 @@ static int freezer_can_attach(struct cgroup_subsys *ss, if (freezer->state == CGROUP_FROZEN) return -EBUSY; + if (threadgroup) { + struct task_struct *c; + + rcu_read_lock(); + list_for_each_entry_rcu(c, &task->thread_group, thread_group) { + if (is_task_frozen_enough(c)) { + rcu_read_unlock(); + return -EBUSY; + } + } + rcu_read_unlock(); + } + return 0; }