diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-12-27 01:25:55 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-01-05 12:59:46 -0500 |
commit | 0d19ea866562e46989412a0676412fa0983c9ce7 (patch) | |
tree | 335439bc9d13da86a7b6955907a92ddab03ceb57 /kernel | |
parent | 305f3c8b20ba1ca94829329acdbf22e689304dba (diff) |
cgroup: fix to allow mounting a hierarchy by name
If we mount a hierarchy with a specified name, the name is unique,
and we can use it to mount the hierarchy without specifying its
set of subsystem names. This feature is documented is
Documentation/cgroups/cgroups.txt section 2.3
Here's an example:
# mount -t cgroup -o cpuset,name=myhier xxx /cgroup1
# mount -t cgroup -o name=myhier xxx /cgroup2
But it was broken by commit 32a8cf235e2f192eb002755076994525cdbaa35a
(cgroup: make the mount options parsing more accurate)
This fixes the regression.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cgroup.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index bab5c17e7781..39c7caef085a 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1193,10 +1193,10 @@ static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts) | |||
1193 | 1193 | ||
1194 | /* | 1194 | /* |
1195 | * If the 'all' option was specified select all the subsystems, | 1195 | * If the 'all' option was specified select all the subsystems, |
1196 | * otherwise 'all, 'none' and a subsystem name options were not | 1196 | * otherwise if 'none', 'name=' and a subsystem name options |
1197 | * specified, let's default to 'all' | 1197 | * were not specified, let's default to 'all' |
1198 | */ | 1198 | */ |
1199 | if (all_ss || (!all_ss && !one_ss && !opts->none)) { | 1199 | if (all_ss || (!one_ss && !opts->none && !opts->name)) { |
1200 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { | 1200 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { |
1201 | struct cgroup_subsys *ss = subsys[i]; | 1201 | struct cgroup_subsys *ss = subsys[i]; |
1202 | if (ss == NULL) | 1202 | if (ss == NULL) |