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

Re: [PATCH] One more bugfix for xfs_lowbit64



On Fri, 2003-08-22 at 15:10, Andi Kleen wrote:
> (mea culpa). The error return was broken too, it would return -2,
> not -1 for errors. Makes no difference in the callers, they never check
> for -1, but is still better to conform to the spec.
> 
> Includes the previous fix for bits > 32.
> 
> -Andi
> 
> --- linux-2.6.0test3/fs/xfs/xfs_bit.c-o	2003-05-27 03:00:41.000000000 +0200
> +++ linux-2.6.0test3/fs/xfs/xfs_bit.c	2003-08-22 22:08:14.000000000 +0200
> @@ -156,12 +156,12 @@
>  {
>  	int n;
>  	n = ffs((unsigned)v);
> -	if (n == 0) {
> +	if (n < 0) {
>  		n = ffs(v >> 32);
>  		if (n >= 0)
>  			n+=32;
>  	}
> -	return n-1;
> +	return (n < 0) ? n : n-1;
>  }
>  
>  /*

You know, on second thoughts, are you sure about that? generic_ffs
and man ffs seem to suggest otherwise.

Steve


-- 

Steve Lord                                      voice: +1-651-683-3511
Principal Engineer, Filesystem Software         email: lord@sgi.com