Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-3.12-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup

Pull cgroup fixes from Tejun Heo:
"Two late fixes for cgroup.

One fixes descendant walk introduced during this rc1 cycle. The other
fixes a post 3.9 bug during task attach which can lead to hang. Both
fixes are critical and the fixes are relatively straight-forward"

* 'for-3.12-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
cgroup: fix to break the while loop in cgroup_attach_task() correctly
cgroup: fix cgroup post-order descendant walk of empty subtree

+6 -8
+6 -8
kernel/cgroup.c
··· 2039 2039 2040 2040 /* @tsk either already exited or can't exit until the end */ 2041 2041 if (tsk->flags & PF_EXITING) 2042 - continue; 2042 + goto next; 2043 2043 2044 2044 /* as per above, nr_threads may decrease, but not increase. */ 2045 2045 BUG_ON(i >= group_size); ··· 2047 2047 ent.cgrp = task_cgroup_from_root(tsk, root); 2048 2048 /* nothing to do if this task is already in the cgroup */ 2049 2049 if (ent.cgrp == cgrp) 2050 - continue; 2050 + goto next; 2051 2051 /* 2052 2052 * saying GFP_ATOMIC has no effect here because we did prealloc 2053 2053 * earlier, but it's good form to communicate our expectations. ··· 2055 2055 retval = flex_array_put(group, i, &ent, GFP_ATOMIC); 2056 2056 BUG_ON(retval != 0); 2057 2057 i++; 2058 - 2058 + next: 2059 2059 if (!threadgroup) 2060 2060 break; 2061 2061 } while_each_thread(leader, tsk); ··· 3188 3188 3189 3189 WARN_ON_ONCE(!rcu_read_lock_held()); 3190 3190 3191 - /* if first iteration, visit the leftmost descendant */ 3192 - if (!pos) { 3193 - next = css_leftmost_descendant(root); 3194 - return next != root ? next : NULL; 3195 - } 3191 + /* if first iteration, visit leftmost descendant which may be @root */ 3192 + if (!pos) 3193 + return css_leftmost_descendant(root); 3196 3194 3197 3195 /* if we visited @root, we're done */ 3198 3196 if (pos == root)