From: Weng Meiling <wengmeiling.w...@huawei.com> Unloading the cgroup filesystem with cgclear -l config, if there is an umount subsystem in the mount section. The error message is "cgclear failed with Success". This is broken. So fix it, replace the error message with "cgclear failed with Cgroup invalid operation",
This patch checks whether the subsystem is mounted before umount the cgroup filesystem. For multi subsystems mounted on one place in the config, just only all subsystems are not mounted, report the error. The detail message about this question is in: http://sourceforge.net/mailarchive/forum.php?thread_name=51E8F2F8.2010909%40huawei.com&forum_name=libcg-devel Signed-off-by: Weng Meiling <wengmeiling.w...@huawei.com> --- src/config.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/config.c b/src/config.c index 06f559b..2cb4c9e 100644 --- a/src/config.c +++ b/src/config.c @@ -1150,6 +1150,7 @@ static int cgroup_config_try_unmount(struct cg_mount_table_s *mount_info) int ret, lvl; struct cgroup_file_info info; char *saveptr = NULL; + char path[FILENAME_MAX]; /* parse the first controller name from list of controllers */ controller_list = strdup(mount_info->name); @@ -1158,6 +1159,13 @@ static int cgroup_config_try_unmount(struct cg_mount_table_s *mount_info) return ECGOTHER; } controller = strtok_r(controller_list, ",", &saveptr); + + while (controller != NULL) { + if (cg_build_path("/", path, controller)) + break; + controller = strtok_r(NULL, ",", &saveptr); + } + if (!controller) { free(controller_list); return ECGINVAL; -- 1.8.2.2 ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel