Description of problem: cgclear command return an error value if it finish the unmounting and there was a subdirectory in the directory to which the control group was mounted. Version-Release number of selected component (if applicable): 0.37rc Steps to Reproduce: 1. mkdir /mnt/cgroups/cpu 2. mkdir /mnt/cgroups/cpu/pom 3. mount -t cgroup -o cpu cpu /mnt/cgroups/cpu 4. cgclear cgclear failed with Directory not empty but the cgclear command was successful: 5. lscgroup cgroups can't be listed: Cgroup is not mounted Actual results: $ cgclear cgclear failed with Directory not empty Expected results: $ cgclear
more verbose example (with the output of /proc/cgroups content): ++ mkdir /mnt/cgroups/cpu ++ mkdir /mnt/cgroups/cpu/pom ++ mount -t cgroup -o cpu cpu /mnt/cgroups/cpu ++ cat /proc/cgroups #subsys_name hierarchy num_cgroups enabled cpuset 0 1 1 ns 0 1 1 cpu 9 1 1 cpuacct 0 1 1 memory 0 1 1 devices 0 1 1 freezer 0 1 1 net_cls 0 1 1 blkio 0 1 1 ++ cgclear cgclear failed with Directory not empty ++ cat /proc/cgroups #subsys_name hierarchy num_cgroups enabled cpuset 0 1 1 ns 0 1 1 cpu 0 1 1 cpuacct 0 1 1 memory 0 1 1 devices 0 1 1 freezer 0 1 1 net_cls 0 1 1 blkio 0 1 1
Created attachment 459997 [details] strace of the relevant cgclear command strace of the relevant cgclear command
Created attachment 460018 [details] proposed fix Does this do the job?