[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6599ad830802170918q4c748f7fs32e5b8ea63e49f15@mail.gmail.com>
Date: Sun, 17 Feb 2008 09:18:44 -0800
From: "Paul Menage" <menage@...gle.com>
To: "Paul Jackson" <pj@....com>
Cc: balbir@...ibm.com, xemul@...nvz.org,
kamezawa.hiroyu@...fujitsu.com, vatsa@...ux.vnet.ibm.com,
akpm@...ux-foundation.org, containers@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 7/7] CGroup API: Update cpusets to use cgroup structured file API
On Feb 16, 2008 7:29 PM, Paul Jackson <pj@....com> wrote:
>
> From: Paul Jackson <pj@....com>
>
> Strip all trailing whitespace (such as carriage returns)
> when parsing integer writes to cgroup files, not just
> one trailing newline if present.
Sounds like a good idea to me. Thanks for this.
>
> Signed-off-by: Paul Jackson <pj@....com>
> Cc: Paul Menage <menage@...gle.com>
Acked-by: Paul Menage <menage@...gle.com>
>
> ---
> kernel/cgroup.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- 2.6.24-mm1.orig/kernel/cgroup.c 2008-02-16 04:20:33.000000000 -0800
> +++ 2.6.24-mm1/kernel/cgroup.c 2008-02-16 19:00:41.207478218 -0800
> @@ -1321,10 +1321,7 @@ static ssize_t cgroup_write_uint(struct
> return -EFAULT;
>
> buffer[nbytes] = 0; /* nul-terminate */
> -
> - /* strip newline if necessary */
> - if (nbytes && (buffer[nbytes-1] == '\n'))
> - buffer[nbytes-1] = 0;
> + strstrip(buffer); /* strip -just- trailing whitespace */
> val = simple_strtoull(buffer, &end, 0);
> if (*end)
> return -EINVAL;
>
>
> --
> I won't rest till it's the best ...
> Programmer, Linux Scalability
> Paul Jackson <pj@....com> 1.940.382.4214
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists