Wrong error handling in nfs4acl
PATCH 1/1 Wrong error handling in nfs4acl
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.
fs/nfsd/nfs4acl.c renamed from fs/nfsd/nfs4acl.c.orig +1 -1
@@ -790,7 +790,7 @@ nfs4_acl_split(struct nfs4_acl *acl, strcontinue ; 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;
Quoted 10 lines · Eric Sesterhenn
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 <[email protected]>
Thanks! Applied to my tree.--b.
Quoted 16 lines · On Tuesday March 7, [email protected] 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 <[email protected]>
fs/nfsd/nfs4acl.c nfs4_acl_split(struct nfs4_acl *acl, str · line 796
Quoted 8 lines
fs/nfsd/nfs4acl.c renamed from fs/nfsd/nfs4acl.c.orig +1
-1@@ -790,7 +790,7 @@ nfs4_acl_split(struct nfs4_acl *acl, strcontinue ; 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?
Quoted 2 lines · Neil Brown
I think we want to change
nfs4_acl_add_aceto return-ENOMEMrather than -1 too.
Whoops, yes, a search for "-1" in that file produces a number of dubious returns. I'll make a patch.
--b.