Re: [PATCH 04/11] xfsprogs: xfsdb: remove unnessary checks in process_leaf_node_dir_v2_free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 02, 2015 at 04:49:20PM +0530, Vivek Trivedi wrote:
> xfs_dir2_free_hdr_t entries are unsigned, so they can't be negative.
> remove these unnessary checks in process_leaf_node_dir_v2_free.
> Reported by coverity.
> 
> Signed-off-by: Vivek Trivedi <t.vivek@xxxxxxxxxxx>
> ---
>  db/check.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/db/check.c b/db/check.c
> index 9c1541d..9d986b9 100644
> --- a/db/check.c
> +++ b/db/check.c
> @@ -3073,9 +3073,7 @@ process_leaf_node_dir_v3_free(
>  		return;
>  	}
>  	if (be32_to_cpu(free->hdr.nvalid) > maxent || 
> -				be32_to_cpu(free->hdr.nvalid) < 0 ||
>  				be32_to_cpu(free->hdr.nused) > maxent || 
> -				be32_to_cpu(free->hdr.nused) < 0 ||
>  				be32_to_cpu(free->hdr.nused) > 
>  					be32_to_cpu(free->hdr.nvalid)) {
>  		if (!sflag || v)

Pretty meaningless, but I think we made this change libxfs code some
time ago, so we may as well change it here....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux