* [Patch] Wrong error handling in nfs4acl
@ 2006-03-07 19:57 Eric Sesterhenn
2006-03-07 22:58 ` J. Bruce Fields
2006-03-07 23:06 ` Neil Brown
0 siblings, 2 replies; 4+ messages in thread
From: Eric Sesterhenn @ 2006-03-07 19:57 UTC (permalink / raw)
To: linux-kernel; +Cc: neilb
hi,
this fixes coverity id #3. Coverity detected dead code,
since the == -1 comparison only returns 0 or 1 to error.
Therefore the if ( error < 0 ) statement was always false.
Seems that this was an if( error = nfs4... ) statement some time
ago, which got broken during cleanup.
Just compile tested.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.16-rc5-mm1/fs/nfsd/nfs4acl.c.orig 2006-03-07 20:52:34.000000000 +0100
+++ linux-2.6.16-rc5-mm1/fs/nfsd/nfs4acl.c 2006-03-07 20:53:08.000000000 +0100
@@ -790,7 +790,7 @@ nfs4_acl_split(struct nfs4_acl *acl, str
continue;
error = nfs4_acl_add_ace(dacl, ace->type, ace->flag,
- ace->access_mask, ace->whotype, ace->who) == -1;
+ ace->access_mask, ace->whotype, ace->who);
if (error < 0)
goto out;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] Wrong error handling in nfs4acl
2006-03-07 19:57 [Patch] Wrong error handling in nfs4acl Eric Sesterhenn
@ 2006-03-07 22:58 ` J. Bruce Fields
2006-03-07 23:06 ` Neil Brown
1 sibling, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2006-03-07 22:58 UTC (permalink / raw)
To: Eric Sesterhenn; +Cc: linux-kernel, neilb
On Tue, Mar 07, 2006 at 08:57:00PM +0100, Eric Sesterhenn wrote:
> hi,
>
> this fixes coverity id #3. Coverity detected dead code,
> since the == -1 comparison only returns 0 or 1 to error.
> Therefore the if ( error < 0 ) statement was always false.
> Seems that this was an if( error = nfs4... ) statement some time
> ago, which got broken during cleanup.
> Just compile tested.
>
> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Thanks! Applied to my tree.--b.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] Wrong error handling in nfs4acl
2006-03-07 19:57 [Patch] Wrong error handling in nfs4acl Eric Sesterhenn
2006-03-07 22:58 ` J. Bruce Fields
@ 2006-03-07 23:06 ` Neil Brown
2006-03-07 23:15 ` J. Bruce Fields
1 sibling, 1 reply; 4+ messages in thread
From: Neil Brown @ 2006-03-07 23:06 UTC (permalink / raw)
To: Eric Sesterhenn, J. Bruce Fields; +Cc: linux-kernel
On Tuesday March 7, snakebyte@gmx.de wrote:
> hi,
>
> this fixes coverity id #3. Coverity detected dead code,
> since the == -1 comparison only returns 0 or 1 to error.
> Therefore the if ( error < 0 ) statement was always false.
> Seems that this was an if( error = nfs4... ) statement some time
> ago, which got broken during cleanup.
> Just compile tested.
>
> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
>
>
> --- linux-2.6.16-rc5-mm1/fs/nfsd/nfs4acl.c.orig 2006-03-07 20:52:34.000000000 +0100
> +++ linux-2.6.16-rc5-mm1/fs/nfsd/nfs4acl.c 2006-03-07 20:53:08.000000000 +0100
> @@ -790,7 +790,7 @@ nfs4_acl_split(struct nfs4_acl *acl, str
> continue;
>
> error = nfs4_acl_add_ace(dacl, ace->type, ace->flag,
> - ace->access_mask, ace->whotype, ace->who) == -1;
> + ace->access_mask, ace->whotype, ace->who);
> if (error < 0)
> goto out;
>
>
Yeh, thanks....
I think we want to change nfs4_acl_add_ace to return -ENOMEM rather
than -1 too.
Bruce?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] Wrong error handling in nfs4acl
2006-03-07 23:06 ` Neil Brown
@ 2006-03-07 23:15 ` J. Bruce Fields
0 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2006-03-07 23:15 UTC (permalink / raw)
To: Neil Brown; +Cc: Eric Sesterhenn, linux-kernel
On Wed, Mar 08, 2006 at 10:06:35AM +1100, Neil Brown wrote:
> I think we want to change nfs4_acl_add_ace to return -ENOMEM rather
> than -1 too.
Whoops, yes, a search for "-1" in that file produces a number of dubious
returns. I'll make a patch.
--b.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-03-07 23:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-07 19:57 [Patch] Wrong error handling in nfs4acl Eric Sesterhenn
2006-03-07 22:58 ` J. Bruce Fields
2006-03-07 23:06 ` Neil Brown
2006-03-07 23:15 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox