Commit 5877019d authored by Tejun Heo's avatar Tejun Heo

device_cgroup: remove direct access to cgroup->children

Currently, devcg::has_children() directly tests cgroup->children for
list emptiness.  The field is not a published field and scheduled to
go away.  In addition, the test isn't strictly correct as devcg should
only care about children which are visible to userland.

This patch converts has_children() to use css_next_child() instead.
The subtle incorrectness is noted and will be dealt with later.
Signed-off-by: default avatarTejun Heo <>
Acked-by: default avatarAristeu Rozanski <>
Acked-by: default avatarSerge Hallyn <>
Acked-by: default avatarLi Zefan <>
parent ea280e7b
......@@ -589,9 +589,17 @@ static int propagate_exception(struct dev_cgroup *devcg_root,
static inline bool has_children(struct dev_cgroup *devcgroup)
struct cgroup *cgrp = devcgroup->css.cgroup;
bool ret;
return !list_empty(&cgrp->children);
* FIXME: There may be lingering offline csses and this function
* may return %true when there isn't any userland-visible child
* which is incorrect for our purposes.
ret = css_next_child(NULL, &devcgroup->css);
return ret;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment