LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH -mm] cgroup: fix boot option parsing
@ 2008-03-17  8:24 Li Zefan
  2008-03-17  8:26 ` Paul Menage
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2008-03-17  8:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Paul Menage, Balbir Singh, LKML, Linux Containers

When boot with 'cgroup_disable=cpuacct', it turns out subsystem
'cpu' is disabled.

When Balbir posted the patch to add cgroup boot option support,
Paul M noticed this problem, but the patch was accepted without
fixing it.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 kernel/cgroup.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index e8e8ec4..54c28ea 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3062,25 +3062,22 @@ static void cgroup_release_agent(struct work_struct *work)
 static int __init cgroup_disable(char *str)
 {
 	int i;
+	char *token;
+
+	while ((token = strsep(&str, ",")) != NULL) {
+		if (!*token)
+			continue;
 
-	while (*str) {
 		for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
 			struct cgroup_subsys *ss = subsys[i];
 
-			if (!strncmp(str, ss->name, strlen(ss->name))) {
+			if (!strcmp(token, ss->name)) {
 				ss->disabled = 1;
 				printk(KERN_INFO "Disabling %s control group"
 					" subsystem\n", ss->name);
 				break;
 			}
 		}
-		/*
-		 * Find the next option if any
-		 */
-		while (*str && (*str != ','))
-			str++;
-		if (*str == ',')
-			str++;
 	}
 	return 1;
 }
-- 
1.5.4.rc3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -mm] cgroup: fix boot option parsing
  2008-03-17  8:24 [PATCH -mm] cgroup: fix boot option parsing Li Zefan
@ 2008-03-17  8:26 ` Paul Menage
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Menage @ 2008-03-17  8:26 UTC (permalink / raw)
  To: Li Zefan; +Cc: Andrew Morton, Balbir Singh, LKML, Linux Containers

On Mon, Mar 17, 2008 at 4:24 PM, Li Zefan <lizf@cn.fujitsu.com> wrote:
> When boot with 'cgroup_disable=cpuacct', it turns out subsystem
>  'cpu' is disabled.
>
>  When Balbir posted the patch to add cgroup boot option support,
>  Paul M noticed this problem, but the patch was accepted without
>  fixing it.
>
>  Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

Acked-by: Paul Menage <menage@google.com>

>  ---
>   kernel/cgroup.c |   15 ++++++---------
>   1 files changed, 6 insertions(+), 9 deletions(-)
>
>  diff --git a/kernel/cgroup.c b/kernel/cgroup.c
>  index e8e8ec4..54c28ea 100644
>  --- a/kernel/cgroup.c
>  +++ b/kernel/cgroup.c
>  @@ -3062,25 +3062,22 @@ static void cgroup_release_agent(struct work_struct *work)
>   static int __init cgroup_disable(char *str)
>   {
>         int i;
>  +       char *token;
>  +
>  +       while ((token = strsep(&str, ",")) != NULL) {
>  +               if (!*token)
>  +                       continue;
>
>  -       while (*str) {
>                 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
>                         struct cgroup_subsys *ss = subsys[i];
>
>  -                       if (!strncmp(str, ss->name, strlen(ss->name))) {
>  +                       if (!strcmp(token, ss->name)) {
>                                 ss->disabled = 1;
>                                 printk(KERN_INFO "Disabling %s control group"
>                                         " subsystem\n", ss->name);
>                                 break;
>                         }
>                 }
>  -               /*
>  -                * Find the next option if any
>  -                */
>  -               while (*str && (*str != ','))
>  -                       str++;
>  -               if (*str == ',')
>  -                       str++;
>         }
>         return 1;
>   }
>  --
>  1.5.4.rc3
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-17  8:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-17  8:24 [PATCH -mm] cgroup: fix boot option parsing Li Zefan
2008-03-17  8:26 ` Paul Menage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).