----- Original Message -----
> From: "Weng Meiling" <wengmeiling.w...@huawei.com>
> To: "Ivana Varekova" <varek...@redhat.com>
> Cc: libcg-devel@lists.sourceforge.net, "libo chen" <libo.c...@huawei.com>
> Sent: Thursday, 3 July, 2014 1:28:00 PM
> Subject: Re: [Libcg-devel] [PATCH] cgclear: clear the mount info
> 
> On 2014/6/30 22:57, Ivana Varekova wrote:
> > Please can you add some example here?
> > Ivana
> > 
> 
> Of course, but do you see Dhaval's reply? I agree with him. What do you
> think?
> 
> The following is his reply:
> 
> As long as /proc/mounts is correct, we don't have a problem. In
> anycase, /etc/mtab is not the correct way to check mounted
> filesystems. It is always /proc/mounts.
> 
> This patch is unnecessary (and dangerous)

Sorry, I overlook the answer, Dhaval is absolutely right.
Ivana

> 
> 
> 
> The following is example:
> 
> # mount -t cgroup cgroup /cgroup
> # mount
> /dev/sdb2 on / type ext3 (rw,acl,user_xattr)
> proc on /proc type proc (rw)
> sysfs on /sys type sysfs (rw)
> devtmpfs on /dev type devtmpfs (rw,mode=0755)
> tmpfs on /dev/shm type tmpfs (rw,mode=1777)
> devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
> fusectl on /sys/fs/fuse/connections type fusectl (rw)
> securityfs on /sys/kernel/security type securityfs (rw)
> cgroup on /cgroup type cgroup (rw)
> 
> 
> # cgclear
> # mount
> /dev/sdb2 on / type ext3 (rw,acl,user_xattr)
> proc on /proc type proc (rw)
> sysfs on /sys type sysfs (rw)
> devtmpfs on /dev type devtmpfs (rw,mode=0755)
> tmpfs on /dev/shm type tmpfs (rw,mode=1777)
> devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
> fusectl on /sys/fs/fuse/connections type fusectl (rw)
> securityfs on /sys/kernel/security type securityfs (rw)
> cgroup on /cgroup type cgroup (rw)
> 
> 
> > ----- Original Message -----
> >> From: "Weng Meiling" <wengmeiling.w...@huawei.com>
> >> To: libcg-devel@lists.sourceforge.net
> >> Cc: "libo chen" <libo.c...@huawei.com>
> >> Sent: Friday, August 2, 2013 10:24:49 AM
> >> Subject: [Libcg-devel] [PATCH] cgclear: clear the mount info
> >>
> >>
> >> 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.
> >>
> >> 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
> >>
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Get your SQL database under version control now!
> >> Version control is standard for application code, but databases havent
> >> caught up. So what steps can you take to put your SQL databases under
> >> version control? Why should you start doing it? Read more to find out.
> >> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Libcg-devel mailing list
> >> Libcg-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/libcg-devel
> >>
> > 
> > .
> > 
> 
> 
> 

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to