When ->pre_destroy() is called, it should be guaranteed that new child cgroup is not created under a cgroup, where pre_destroy() is running. If not, ->pre_destroy() must check children and return -EBUSY, which causes warning. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> --- kernel/cgroup.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 7a3076b..003ceed 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -3970,6 +3970,15 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, mutex_lock(&cgroup_mutex); + /* + * prevent making child cgroup when ->pre_destroy() is running. + */ + if (test_bit(CGRP_WAIT_ON_RMDIR, &parent->flags)) { + mutex_unlock(&cgroup_mutex); + atomic_dec(&sb->s_active); + return -EBUSY; + } + init_cgroup_housekeeping(cgrp); cgrp->parent = parent; -- 1.7.4.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>