From 4dbab1592c66117b8c84b0440cd71419e53cae67 Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Wed, 2 Nov 2011 13:38:07 -0700 Subject: [PATCH] --- yaml --- r: 273239 b: refs/heads/master c: 77ceab8ea590d7dc6c8f055ce43dfebd74428107 h: refs/heads/master i: 273237: a5a2f17342ff1ed21f77a2df76325d01ed6e591c 273235: fa141bcf4a3c97095ac0a578e57d586b2bf01730 273231: 1f7efcae4da6a3e9c55d465deab6ad8532f94cf3 v: v3 --- [refs] | 2 +- trunk/kernel/cgroup.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index bf440707a067..874117cb9c5c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 33ef6b6984403a688189317ef46bb3caab3b70e0 +refs/heads/master: 77ceab8ea590d7dc6c8f055ce43dfebd74428107 diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index 64b0e73402df..8386b21224ef 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -2135,14 +2135,17 @@ int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader) oldcgrp = task_cgroup_from_root(tsk, root); if (cgrp == oldcgrp) continue; - /* attach each task to each subsystem */ - for_each_subsys(root, ss) { - if (ss->attach_task) - ss->attach_task(cgrp, tsk); - } /* if the thread is PF_EXITING, it can just get skipped. */ retval = cgroup_task_migrate(cgrp, oldcgrp, tsk, true); - BUG_ON(retval != 0 && retval != -ESRCH); + if (retval == 0) { + /* attach each task to each subsystem */ + for_each_subsys(root, ss) { + if (ss->attach_task) + ss->attach_task(cgrp, tsk); + } + } else { + BUG_ON(retval != -ESRCH); + } } /* nothing is sensitive to fork() after this point. */