Re: [PATCH] lib/crc32: prefix public functions

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

 



On Mon, Oct 10, 2016 at 05:54:24PM -0300, Gustavo Zacarias wrote:
> --- a/disk-utils/fsck.cramfs.c
> +++ b/disk-utils/fsck.cramfs.c
> @@ -214,7 +214,7 @@ static void test_crc(int start)
>  		return;
>  	}
>  
> -	crc = crc32(0L, Z_NULL, 0);
> +	crc = ul_crc32(0L, Z_NULL, 0);
>  
>  	buf =
>  	    mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
> @@ -231,8 +231,8 @@ static void test_crc(int start)
>  	}
>  	if (buf != MAP_FAILED) {
>  		((struct cramfs_super *)((unsigned char *) buf + start))->fsid.crc =
> -		    crc32(0L, Z_NULL, 0);
> -		crc = crc32(crc, (unsigned char *) buf + start, super.size - start);
> +		    ul_crc32(0L, Z_NULL, 0);
> +		crc = ul_crc32(crc, (unsigned char *) buf + start, super.size - start);

BTW, this is incorrect. cramfs code is based on crc32 from zlib :-)

The difference is that zlib does the final post-conditioning. Our
implementation requires this step (xor) from application. 

It's fine to use zlib there, because we also use compression from the
library for cramfs.

I have reverted the change for {mkfs,fsck}.cramfs.c

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux