All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cgroup: set 'start' with the right value in cgroup_path.
@ 2012-11-08 13:36 Tao Ma
  2012-11-08 14:24 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Tao Ma @ 2012-11-08 13:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tejun Heo, Li Zefan

From: Tao Ma <boyu.mt@taobao.com>

'start' is set to buf + buflen and do the '--' immediately.
Just set it to 'buf + buflen - 1' directly.

Cc: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
---
 kernel/cgroup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f24f724..a9f8388 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1821,9 +1821,9 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen)
 		return 0;
 	}
 
-	start = buf + buflen;
+	start = buf + buflen - 1;
 
-	*--start = '\0';
+	*start = '\0';
 	for (;;) {
 		int len = dentry->d_name.len;
 
-- 
1.7.1


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

* Re: [PATCH] cgroup: set 'start' with the right value in cgroup_path.
  2012-11-08 13:36 [PATCH] cgroup: set 'start' with the right value in cgroup_path Tao Ma
@ 2012-11-08 14:24 ` Tejun Heo
  2012-11-08 14:31   ` Tao Ma
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2012-11-08 14:24 UTC (permalink / raw)
  To: Tao Ma; +Cc: linux-kernel, Li Zefan

Hello,

On Thu, Nov 08, 2012 at 09:36:38PM +0800, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
> 
> 'start' is set to buf + buflen and do the '--' immediately.
> Just set it to 'buf + buflen - 1' directly.
> 
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Li Zefan <lizefan@huawei.com>

You're missing S-O-B.  I added it while applying.  Please ack if you
agree.

Heh, I'm not sure how much of an improvement this is but there's
obviously nothing wrong with it either.  Applying to cgroup/for-3.8.

Thanks.

-- 
tejun

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

* Re: [PATCH] cgroup: set 'start' with the right value in cgroup_path.
  2012-11-08 14:24 ` Tejun Heo
@ 2012-11-08 14:31   ` Tao Ma
  0 siblings, 0 replies; 3+ messages in thread
From: Tao Ma @ 2012-11-08 14:31 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-kernel, Li Zefan

On 11/08/2012 10:24 PM, Tejun Heo wrote:
> Hello,
> 
> On Thu, Nov 08, 2012 at 09:36:38PM +0800, Tao Ma wrote:
>> From: Tao Ma <boyu.mt@taobao.com>
>>
>> 'start' is set to buf + buflen and do the '--' immediately.
>> Just set it to 'buf + buflen - 1' directly.
>>
>> Cc: Tejun Heo <tj@kernel.org>
>> Cc: Li Zefan <lizefan@huawei.com>
> 
> You're missing S-O-B.  I added it while applying.  Please ack if you
> agree.
oops, sorry, please add
Signed-off-by: Tao Ma <boyu.mt@taobao.com>

Thanks
Tao
> 
> Heh, I'm not sure how much of an improvement this is but there's
> obviously nothing wrong with it either.  Applying to cgroup/for-3.8.
> 
> Thanks.
> 


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

end of thread, other threads:[~2012-11-08 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 13:36 [PATCH] cgroup: set 'start' with the right value in cgroup_path Tao Ma
2012-11-08 14:24 ` Tejun Heo
2012-11-08 14:31   ` Tao Ma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.