diff options
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 3fb789f6df94..3737a682cdf5 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -843,6 +843,11 @@ static int parse_cgroupfs_options(char *data, | |||
843 | struct cgroup_sb_opts *opts) | 843 | struct cgroup_sb_opts *opts) |
844 | { | 844 | { |
845 | char *token, *o = data ?: "all"; | 845 | char *token, *o = data ?: "all"; |
846 | unsigned long mask = (unsigned long)-1; | ||
847 | |||
848 | #ifdef CONFIG_CPUSETS | ||
849 | mask = ~(1UL << cpuset_subsys_id); | ||
850 | #endif | ||
846 | 851 | ||
847 | opts->subsys_bits = 0; | 852 | opts->subsys_bits = 0; |
848 | opts->flags = 0; | 853 | opts->flags = 0; |
@@ -887,6 +892,15 @@ static int parse_cgroupfs_options(char *data, | |||
887 | } | 892 | } |
888 | } | 893 | } |
889 | 894 | ||
895 | /* | ||
896 | * Option noprefix was introduced just for backward compatibility | ||
897 | * with the old cpuset, so we allow noprefix only if mounting just | ||
898 | * the cpuset subsystem. | ||
899 | */ | ||
900 | if (test_bit(ROOT_NOPREFIX, &opts->flags) && | ||
901 | (opts->subsys_bits & mask)) | ||
902 | return -EINVAL; | ||
903 | |||
890 | /* We can't have an empty hierarchy */ | 904 | /* We can't have an empty hierarchy */ |
891 | if (!opts->subsys_bits) | 905 | if (!opts->subsys_bits) |
892 | return -EINVAL; | 906 | return -EINVAL; |