[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110815231156.GC6867@unix33.andrew.cmu.edu>
Date: Mon, 15 Aug 2011 19:11:56 -0400
From: Ben Blum <bblum@...rew.cmu.edu>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: Oleg Nesterov <oleg@...hat.com>, Ben Blum <bblum@...rew.cmu.edu>,
NeilBrown <neilb@...e.de>, paulmck@...ux.vnet.ibm.com,
Paul Menage <menage@...gle.com>,
Li Zefan <lizf@...fujitsu.com>,
containers@...ts.linux-foundation.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH][BUGFIX] cgroups: fix ordering of calls in
cgroup_attach_proc
Fix ordering of cgroup_task_migrate and attach_task in cgroup_attach_proc.
Signed-off-by: Ben Blum <bblum@...rew.cmu.edu>
---
kernel/cgroup.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff -u a/kernel/cgroup.c b/kernel/cgroup.c
--- a/kernel/cgroup.c 2011-08-15 19:05:37.308401219 -0400
+++ b/kernel/cgroup.c 2011-08-15 19:07:47.376775142 -0400
@@ -2132,14 +2132,17 @@
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. */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists