Skip to content

Commit

Permalink
cgroup: fix broken css_has_online_children()
Browse files Browse the repository at this point in the history
After running:

  # mount -t cgroup cpu xxx /cgroup && mkdir /cgroup/sub && \
    rmdir /cgroup/sub && umount /cgroup

I found the cgroup root still existed:

  # cat /proc/cgroups
  #subsys_name    hierarchy       num_cgroups     enabled
  cpuset  0       1       1
  cpu     1       1       1
  ...

It turned out css_has_online_children() is broken.

Signed-off-by: Li Zefan <[email protected]>
Sigend-off-by: Tejun Heo <[email protected]>
  • Loading branch information
lizf-os authored and htejun committed Jun 17, 2014
1 parent ebe0618 commit 99bae5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -3328,7 +3328,7 @@ bool css_has_online_children(struct cgroup_subsys_state *css)

rcu_read_lock();
css_for_each_child(child, css) {
if (css->flags & CSS_ONLINE) {
if (child->flags & CSS_ONLINE) {
ret = true;
break;
}
Expand Down

0 comments on commit 99bae5f

Please sign in to comment.