Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Paul Jackson
pj wrote: > Check out the assembly code generated by: > > BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX)); > > (Hint: you can't find it ;) > > It -is- compile time! To be clear, BUG_ON() in general is a runtime check. But the compiler can optimize out constant expressions, and

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Adrian Bunk
On Thu, Oct 25, 2007 at 06:24:25PM -0700, Paul Jackson wrote: > Paul M wrote: > > Sounds reasonable to me. Is there any kind of compile-time assert > > macro in the kernel? > > Check out the assembly code generated by: > > BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX)); > >

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Paul Menage
On 10/25/07, Paul Jackson <[EMAIL PROTECTED]> wrote: > Paul M wrote: > > Sounds reasonable to me. Is there any kind of compile-time assert > > macro in the kernel? > > Check out the assembly code generated by: > > BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX)); > > (Hint: you can't

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Paul Jackson
Paul M wrote: > Sounds reasonable to me. Is there any kind of compile-time assert > macro in the kernel? Check out the assembly code generated by: BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX)); (Hint: you can't find it ;) It -is- compile time! -- I won't

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Adrian Bunk
On Thu, Oct 25, 2007 at 06:10:24PM -0700, Paul Menage wrote: > On 10/24/07, Paul Jackson <[EMAIL PROTECTED]> wrote: > > Paul M wrote: > > > I think I'd rather not make this change - if we later changed the size > > > of release_agent_path[] this could silently fail. Can we get around > > > the

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Paul Menage
On 10/24/07, Paul Jackson <[EMAIL PROTECTED]> wrote: > Paul M wrote: > > I think I'd rather not make this change - if we later changed the size > > of release_agent_path[] this could silently fail. Can we get around > > the coverity checker somehow? > > Perhaps we can simplify this check then, to:

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Paul Menage
On 10/24/07, Paul Jackson [EMAIL PROTECTED] wrote: Paul M wrote: I think I'd rather not make this change - if we later changed the size of release_agent_path[] this could silently fail. Can we get around the coverity checker somehow? Perhaps we can simplify this check then, to:

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Adrian Bunk
On Thu, Oct 25, 2007 at 06:10:24PM -0700, Paul Menage wrote: On 10/24/07, Paul Jackson [EMAIL PROTECTED] wrote: Paul M wrote: I think I'd rather not make this change - if we later changed the size of release_agent_path[] this could silently fail. Can we get around the coverity checker

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Paul Jackson
Paul M wrote: Sounds reasonable to me. Is there any kind of compile-time assert macro in the kernel? Check out the assembly code generated by: BUG_ON(sizeof(cgrp-root-release_agent_path) PATH_MAX)); (Hint: you can't find it ;) It -is- compile time! -- I won't rest

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Paul Menage
On 10/25/07, Paul Jackson [EMAIL PROTECTED] wrote: Paul M wrote: Sounds reasonable to me. Is there any kind of compile-time assert macro in the kernel? Check out the assembly code generated by: BUG_ON(sizeof(cgrp-root-release_agent_path) PATH_MAX)); (Hint: you can't find it ;) It

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Adrian Bunk
On Thu, Oct 25, 2007 at 06:24:25PM -0700, Paul Jackson wrote: Paul M wrote: Sounds reasonable to me. Is there any kind of compile-time assert macro in the kernel? Check out the assembly code generated by: BUG_ON(sizeof(cgrp-root-release_agent_path) PATH_MAX)); (Hint: you can't

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-25 Thread Paul Jackson
pj wrote: Check out the assembly code generated by: BUG_ON(sizeof(cgrp-root-release_agent_path) PATH_MAX)); (Hint: you can't find it ;) It -is- compile time! To be clear, BUG_ON() in general is a runtime check. But the compiler can optimize out constant expressions, and code

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Paul Jackson
Paul M wrote: > I think I'd rather not make this change - if we later changed the size > of release_agent_path[] this could silently fail. Can we get around > the coverity checker somehow? Perhaps we can simplify this check then, to: BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX));

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Paul Menage
On 10/24/07, Adrian Bunk <[EMAIL PROTECTED]> wrote: > > Two questions: > - Is it really intended to perhaps change release_agent_path[] to have > less than PATH_MAX size? I've got no intention to do so currently. > - If yes, do you want to return -E2BIG for (nbytes >= PATH_MAX) or for >

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Adrian Bunk
On Wed, Oct 24, 2007 at 09:30:23AM -0700, Paul Menage wrote: > I think I'd rather not make this change - if we later changed the size > of release_agent_path[] this could silently fail. Can we get around > the coverity checker somehow? I do not care what the Coverity checker thinks about the

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Paul Menage
I think I'd rather not make this change - if we later changed the size of release_agent_path[] this could silently fail. Can we get around the coverity checker somehow? Paul On 10/24/07, Adrian Bunk <[EMAIL PROTECTED]> wrote: > This patch removes dead code spotted by the Coverity checker > (look

[2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Adrian Bunk
This patch removes dead code spotted by the Coverity checker (look at the "(nbytes >= PATH_MAX)" check). Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> --- kernel/cgroup.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) --- linux-2.6/kernel/cgroup.c.old

[2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Adrian Bunk
This patch removes dead code spotted by the Coverity checker (look at the (nbytes = PATH_MAX) check). Signed-off-by: Adrian Bunk [EMAIL PROTECTED] --- kernel/cgroup.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) --- linux-2.6/kernel/cgroup.c.old 2007-10-23

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Paul Menage
I think I'd rather not make this change - if we later changed the size of release_agent_path[] this could silently fail. Can we get around the coverity checker somehow? Paul On 10/24/07, Adrian Bunk [EMAIL PROTECTED] wrote: This patch removes dead code spotted by the Coverity checker (look at

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Adrian Bunk
On Wed, Oct 24, 2007 at 09:30:23AM -0700, Paul Menage wrote: I think I'd rather not make this change - if we later changed the size of release_agent_path[] this could silently fail. Can we get around the coverity checker somehow? I do not care what the Coverity checker thinks about the code,

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Paul Menage
On 10/24/07, Adrian Bunk [EMAIL PROTECTED] wrote: Two questions: - Is it really intended to perhaps change release_agent_path[] to have less than PATH_MAX size? I've got no intention to do so currently. - If yes, do you want to return -E2BIG for (nbytes = PATH_MAX) or for (nbytes =

Re: [2.6 patch] kernel/cgroup.c: remove dead code

2007-10-24 Thread Paul Jackson
Paul M wrote: I think I'd rather not make this change - if we later changed the size of release_agent_path[] this could silently fail. Can we get around the coverity checker somehow? Perhaps we can simplify this check then, to: BUG_ON(sizeof(cgrp-root-release_agent_path) PATH_MAX)); Less