Bug 676700

Summary: cgsnapshot fails to find all cgroup mountpoints
Product: Red Hat Enterprise Linux 6 Reporter: Mike Gahagan <mgahagan>
Component: libcgroupAssignee: Jan Chaloupka <jchaloup>
Status: CLOSED NEXTRELEASE QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: jsafrane, ovasik, varekova
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-05 07:05:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 672300, 846704    

Description Mike Gahagan 2011-02-10 20:25:58 UTC
Description of problem:

the cgsnapshot utility appears to only work on the first mountpoint when multiple mountpoints are involved. The reproducer below is a modification on libcgroup-tools-tests/libcgroup-tests/cgsnapshot/cgsnapshot_two_mp. Tested both with and without selinux enforcing due to recent issues with selinux policy and some of the libcgroup tools. No avc's were generated in either case so I don't think this has anything to do with SELinux policy.

SELinux enforcing off
[root@test1239 cgsnapshot]# mkdir -p /tmp/cgroups/memory 2>/dev/null
[root@test1239 cgsnapshot]# mkdir -p /tmp/cgroups/pom 2>/dev/null
[root@test1239 cgsnapshot]# mount -t cgroup -o memory memory1 /tmp/cgroups/memory
[root@test1239 cgsnapshot]# mount -t cgroup -o memory memory2 /tmp/cgroups/pom
[root@test1239 cgsnapshot]# cgsnapshot 
# Configuration file generated by cgsnapshot
mount {
	memory = /tmp/cgroups/memory;
}

[root@test1239 cgsnapshot]# mount
/dev/mapper/vg_test1239-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/vda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
memory1 on /tmp/cgroups/memory type cgroup (rw,memory)
memory2 on /tmp/cgroups/pom type cgroup (rw,memory)
[root@test1239 cgsnapshot]# getenforce
Permissive

SELinux enforcing on
[root@test1239 cgsnapshot]# setenforce 1
[root@test1239 cgsnapshot]# mount -t cgroup -o memory memory1 /tmp/cgroups/memory
[root@test1239 cgsnapshot]# mount -t cgroup -o memory memory2 /tmp/cgroups/pom
[root@test1239 cgsnapshot]# cgsnapshot
# Configuration file generated by cgsnapshot
mount {
	memory = /tmp/cgroups/memory;
}

[root@test1239 cgsnapshot]# mount
/dev/mapper/vg_test1239-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/vda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
memory1 on /tmp/cgroups/memory type cgroup (rw,memory)
memory2 on /tmp/cgroups/pom type cgroup (rw,memory)


Version-Release number of selected component (if applicable):
[root@test1239 cgsnapshot]# rpm -q libcgroup
libcgroup-0.37-1.el6.x86_64
[root@test1239 cgsnapshot]# uname -r
2.6.32-115.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. Create 2 or more cgroup mount points and mount them
2. run cgsnapshot
3.
  
Actual results:
only the first mount is displayed in the output

Expected results:
all mountpoints are displayed

Additional info:

Comment 2 Jan Safranek 2011-02-17 12:15:47 UTC
libcgroup is fairly limited when it comes to multiple mount points. Upstream decided that libcgroup handles only one mount point per hierarchy and ignores the others. For 99% of its functionality it's OK, the only problem are tools which lists them, like cgsnapshot and lssubsys. It's a design flaw which I think cannot be fixed in time for RHEL 6.1. We have to re-think the design upstream and don't break things apart.

This bug should be also mentioned somewhere, is errata text enough?

Comment 3 Mike Gahagan 2011-02-17 15:55:01 UTC
In that case we should probably mention this bug in the release notes.

Comment 4 Jan Safranek 2011-02-23 13:56:33 UTC
This bug will get fixed in RHEL 6.2, so I put the release note to the rebase bug #649195.

Comment 6 RHEL Program Management 2011-07-06 01:24:48 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 7 Peter Schiffer 2012-06-13 17:02:28 UTC
Changing priority and severity to medium.

Comment 8 RHEL Program Management 2012-07-10 06:23:14 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 9 RHEL Program Management 2012-07-11 00:00:22 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 10 RHEL Program Management 2012-12-14 07:00:32 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 12 Jan Chaloupka 2014-08-05 07:05:04 UTC
Testing on rhel6.5 with libcgroup-0.40.rc1-10.el6.x86_64:

# mkdir -p /tmp/cgroups/memory 2>/dev/null
# mkdir -p /tmp/cgroups/pom 2>/dev/null
# mount -t cgroup -o memory memory1 /tmp/cgroups/memory
# mount -t cgroup -o memory memory2 /tmp/cgroups/pom
# cgsnapshot 
# Configuration file generated by cgsnapshot
mount {
	memory = /tmp/cgroups/memory;
	memory = /tmp/cgroups/pom;
}

Closing as NEXTRELEASE from point of view of rhel6.1.