Hi Ivana, what do you think about this question ?
Weng Meiling Thanks! On 2013/8/2 16:24, Weng Meiling wrote: > > From: Weng Meiling <wengmeiling.w...@huawei.com> > > When we use cgclear to unload the cgroup filesystem, we still can > see the umounted cgroup by using mount command. So fix the problem > by call system. > just only when mount the cgroup filesystem manually instead of cgconfig service or cgconfigparser , we still can see the mount info. > From: Weng Meiling <wengmeiling.w...@huawei.com> > --- > src/config.c | 18 ++++++++++++++++-- > 1 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/src/config.c b/src/config.c > index 06f559b..967b3f7 100644 > --- a/src/config.c > +++ b/src/config.c > @@ -1141,6 +1141,20 @@ err_mnt: > return error; > } > > +/* umounts given mount */ > +static int umount_system(char *path) > +{ > + char cmd[FILENAME_MAX + 7]; > + int err = -1; > + > + snprintf(cmd, sizeof(cmd), "%s %s", "umount", path); > + err = system(cmd); > + if (err != -1 && WIFEXITED(err) && !WEXITSTATUS(err)) > + err = 0; > + return err; > + > +} > + > /* unmounts given mount, but only if it is empty */ > static int cgroup_config_try_unmount(struct cg_mount_table_s *mount_info) > { > @@ -1197,7 +1211,7 @@ static int cgroup_config_try_unmount(struct > cg_mount_table_s *mount_info) > int err; > cgroup_dbg("unmounting %s at %s\n", mount_info->name, > mount->path); > - err = umount(mount->path); > + err = umount_system(mount->path); > > if (err && !ret) { > ret = ECGOTHER; > @@ -1305,7 +1319,7 @@ static int cgroup_config_unload_controller(const struct > cgroup_mount_point *moun > ret = cgroup_get_subsys_mount_point_begin(mount_info->name, &handle, > path); > while (ret == 0) { > - error = umount(path); > + error = umount_system(path); > if (error) { > cgroup_warn("Warning: cannot unmount controller %s on > %s: %s\n", > mount_info->name, path, > -- 1.7.1 > ------------------------------------------------------------------------------ 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