]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
cgroups: forbid noprefix if mounting more than just cpuset subsystem
authorLi Zefan <lizf@cn.fujitsu.com>
Wed, 17 Jun 2009 23:26:33 +0000 (16:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Jun 2009 20:03:46 +0000 (13:03 -0700)
commitf9ab5b5b0f5be506640321d710b0acd3dca6154a
treeabd8e17febed8507b4c0f96a88d2711fccb31b2b
parent8ca739e3694b83cdf22be0f6eff063e721deb1e4
cgroups: forbid noprefix if mounting more than just cpuset subsystem

The 'noprefix' option was introduced for backwards-compatibility of
cpuset, but actually it can be used when mounting other subsystems.

This results in possibility of name collision, and now the collision can
really happen, because we have 'stat' file in both memory and cpuacct
subsystem:

# mount -t cgroup -o noprefix,memory,cpuacct xxx /mnt

Cgroup will happily mount the 2 subsystems, but only 'stat' file of memory
subsys can be seen.

We don't want users to use nopreifx, and also want to avoid name
collision, so we change to allow noprefix only if mounting just the cpuset
subsystem.

[akpm@linux-foundation.org: fix shift for cpuset_subsys_id >= 32]
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/cgroup.c