login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
October
»
27
Re: [RFC] cgroup simplify space stripping
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Jason Uhlenkott <juhlenko@...>
To: Paul Jackson <pj@...>
Cc: Paul Menage <menage@...>, Adrian Bunk <bunk@...>, <linux-kernel@...>
Subject:
Re: [RFC] cgroup simplify space stripping
Date: Saturday, October 27, 2007 - 1:50 am
On Wed, Oct 24, 2007 at 10:36:21 -0700, Paul Jackson wrote:
quoted text
> From: Paul Jackson <pj@sgi.com> > > Simplify the space stripping code in cgroup file write. > > Signed-off-by: Paul Jackson <pj@sgi.com> > > --- > > This patch applies after both: > Adrian Bunk's: [2.6 patch] kernel/cgroup.c: remove dead code > pj's: [PATCH] cgroup brace coding style fix > > kernel/cgroup.c | 15 +++------------ > 1 file changed, 3 insertions(+), 12 deletions(-) > > --- 2.6.23-mm1.orig/kernel/cgroup.c 2007-10-24 10:03:11.847801501 -0700 > +++ 2.6.23-mm1/kernel/cgroup.c 2007-10-24 10:29:08.355032464 -0700 > @@ -1327,6 +1327,7 @@ static ssize_t cgroup_common_file_write( > goto out1; > } > buffer[nbytes] = 0; /* nul-terminate */ > + strstrip(buffer); /* strip -just- trailing whitespace */ > > mutex_lock(&cgroup_mutex); > > @@ -1347,19 +1348,9 @@ static ssize_t cgroup_common_file_write( > clear_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags); > break; > case FILE_RELEASE_AGENT: > - { > - struct cgroupfs_root *root = cgrp->root; > - /* Strip trailing newline */ > - if (nbytes && (buffer[nbytes-1] == '\n')) > - buffer[nbytes-1] = 0; > - /* We never write anything other than '__PLACEHOLDER__0_' > - * into the last char of release_agent_path, > - * so it always remains a NUL-terminated > - * string */ > - strncpy(root->release_agent_path, buffer, nbytes); > - root->release_agent_path[nbytes] = 0; > + BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
Could be BUILD_BUG_ON, even.
quoted text
> + strcpy(cgrp->root->release_agent_path, buffer); > break; > - } > default: > retval = -EINVAL; > goto out2;
-
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[RFC] cgroup simplify space stripping
, Paul Jackson
, (Wed Oct 24, 1:36 pm)
Re: [RFC] cgroup simplify space stripping
, Jason Uhlenkott
, (Sat Oct 27, 1:50 am)
Re: [RFC] cgroup simplify space stripping
, Jason Uhlenkott
, (Sat Oct 27, 2:00 am)
Re: [RFC] cgroup simplify space stripping
, Paul Menage
, (Thu Oct 25, 9:14 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Tarkan Erimer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Amit K. Arora
[RFC] Heads up on sys_fallocate()
Chuck Ebbert
Why do so many machines need "noapic"?
git
:
linux-netdev
:
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
David Miller
[GIT]: Networking
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Natalie Protasevich
[BUG] New Kernel Bugs
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
0 users
and
420 guests
online.
Syndicate