svn commit: r208779 - head/sys/kern

Robert Watson rwatson at FreeBSD.org
Fri Jun 4 14:40:03 UTC 2010


On Thu, 3 Jun 2010, Edward Tomasz Napierala wrote:

> Author: trasz
> Date: Thu Jun  3 13:41:55 2010
> New Revision: 208779
> URL: http://svn.freebsd.org/changeset/base/208779
>
> Log:
>  The acl_cnt field is unsigned; no point in checking if it's >= 0.

I'd originally left these checks in despite the Coverity warnings to make the 
code robust against developer changes that might include making acl_cnt 
signed.  I'd prefer to put a compile-time assertion in, needless to say, and 
recommend that, since they've been removed, we add one.

Robert

>
>  Found with:	Coverity Prevent
>  CID:		3683
>
> Modified:
>  head/sys/kern/subr_acl_nfs4.c
>
> Modified: head/sys/kern/subr_acl_nfs4.c
> ==============================================================================
> --- head/sys/kern/subr_acl_nfs4.c	Thu Jun  3 13:04:56 2010	(r208778)
> +++ head/sys/kern/subr_acl_nfs4.c	Thu Jun  3 13:41:55 2010	(r208779)
> @@ -342,7 +342,6 @@ acl_nfs4_sync_acl_from_mode(struct acl *
> 	const int WRITE = 02;
> 	const int EXEC = 01;
>
> -	KASSERT(aclp->acl_cnt >= 0, ("aclp->acl_cnt >= 0"));
> 	KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES,
> 	    ("aclp->acl_cnt <= ACL_MAX_ENTRIES"));
>
>


More information about the svn-src-all mailing list