lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 8 Oct 2011 18:18:13 +0000
From:	"Serge E. Hallyn" <serge@...lyn.com>
To:	含黛 <handai.szj@...bao.com>
Cc:	linux-kernel@...r.kernel.org, paul@...lmenage.org,
	lizf@...fujitsu.com
Subject: Re: cgroup umount bug

Quoting 含黛 (handai.szj@...bao.com):
> Hi,
> 
>     I found a mount/umount problem while using cgroup: I mount a cpu
> cgroup (or other subsystems) and create some subgroups under it, but
> later I try to umount it without rmdir those subgroups. I find that I
> can umount it without any errors but actually the super block still
> exist. This is because the sb->s_active count is greater than 1 which
> was added by cgroup_create. But later if I want to mount both cpu and
> memory subsystems, it will be unsuccessful indicating that the
> device(cpu subsystem) is busy. This situation will not happen if I rmdir
> the subgroups manually before umount it. So my question is:
>     Should the umount return success when there are still some subgroups

Yes.  The fs was unmounted from that directory.

> exist ? If this is okay, then it may lead to some *strange* errors using
> cgroup later. If it can not be umount, then it should inform that the
> mount point is still busy.

> Following is an example of this problem:
> 
> mount -t cgroup -o cpu cgroup /mnt
> mkdir /mnt/test
> 
> …..// do some tests
> 
> umount /mnt      /* return successfully */
> 
> /* do other subsystems test */
> mount -cgroup -o cpu,cpuset cgroup /mnt
> mount: cgroup already mounted or /mnt busy  /*??? which is strange */

I'm not sure from what you write whether you're aware of this, but
to work around this, you can then

 mount -t cgroup -o cpu /mnt
 for i in `cat /mnt/test/tasks`; do
  echo $i > /mnt/tasks
 done
 rmdir /mnt/test
 umount /mnt

and now you can 

 mount -cgroup -o cpu,cpuset cgroup /mnt

Being unable to umount /mnt while child cgroups exist or having all
child cgroups cleared and removed automatically would both be less
useful behaviors.

thanks,
-serge
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ