From f98f428f5243940ef6c827097f2189bb3532cf95 Mon Sep 17 00:00:00 2001 From: Gao feng Date: Mon, 3 Dec 2012 09:28:18 +0800 Subject: [PATCH] --- yaml --- r: 339363 b: refs/heads/master c: 7083d0378a1746f2b45729cae494c6b92e75d73f h: refs/heads/master i: 339361: 7e826d25ef415b615b7e4ad70d7a74fcb81be43c 339359: 674ebc62930dd5fbb99935ce9185f33e17ca220e v: v3 --- [refs] | 2 +- trunk/kernel/cgroup.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 17b5bfdaa25d..0e2a63f8d3c5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 879a3d9dbbde823ac77d39131e7a287f31b8296f +refs/heads/master: 7083d0378a1746f2b45729cae494c6b92e75d73f diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index e1293a9189b6..5cc37241a6fb 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -1349,14 +1349,21 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data) goto out_unlock; } + /* + * Clear out the files of subsystems that should be removed, do + * this before rebind_subsystems, since rebind_subsystems may + * change this hierarchy's subsys_list. + */ + cgroup_clear_directory(cgrp->dentry, false, removed_mask); + ret = rebind_subsystems(root, opts.subsys_mask); if (ret) { + /* rebind_subsystems failed, re-populate the removed files */ + cgroup_populate_dir(cgrp, false, removed_mask); drop_parsed_module_refcounts(opts.subsys_mask); goto out_unlock; } - /* clear out any existing files and repopulate subsystem files */ - cgroup_clear_directory(cgrp->dentry, false, removed_mask); /* re-populate subsystem files */ cgroup_populate_dir(cgrp, false, added_mask);