Re: [PATCH] cgroups: forbid noprefix if mounting more than just cpusetsubsystem

From: Li Zefan
Date: Tue Jun 02 2009 - 02:42:27 EST


>> + /* We allow noprefix only if mounting just the cpuset subsystem */
>> + if (test_bit(ROOT_NOPREFIX, &opts->flags) &&
>> + (opts->subsys_bits & mask))
>> + return -EINVAL;
>> +
>
> uh, OK. I hope that comment is clear enough for anyone who wants to
> understand it. It doesn't explain _why_ this is done..
>

I agree more explanation is better..

====

From: Li Zefan <lizf@xxxxxxxxxxxxxx>
Subject: [PATCH] cgroups: forbid noprefix if mounting more than just cpuset subsystem, fix2

Explain more on the noprefix option.

Signed-off-by: Li Zefan <lizf@xxxxxxxxxxxxxx>
---
kernel/cgroup.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index ad17f9d..d15432c 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -891,7 +891,11 @@ static int parse_cgroupfs_options(char *data,
}
}

- /* We allow noprefix only if mounting just the cpuset subsystem */
+ /*
+ * Option noprefix was introduced just for backward compatibility
+ * with the old cpuset, so we allow noprefix only if mounting just
+ * the cpuset subsystem.
+ */
if (test_bit(ROOT_NOPREFIX, &opts->flags) &&
(opts->subsys_bits & mask))
return -EINVAL;
--
1.5.4.rc3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/