CRC32C big endian bugs...

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <chris.mason@...>
Cc: <linux-kernel@...>, <linux-fsdevel@...>, <btrfs-devel@...>
Date: Tuesday, February 12, 2008 - 5:23 am

The CRC32C implementation in the btrfs progs is different from the one
in the kernel, so obviously nothing can possibly work on big-endian.

This is getting less and less fun by the minute, I simply wanted to
test btrfs on Niagara :-/

Here is a patch to fix that:

--- vanilla/btrfs-progs-0.12/crc32c.c	2008-02-06 08:37:45.000000000 -0800
+++ btrfs-progs-0.12/crc32c.c	2008-02-12 01:19:33.000000000 -0800
@@ -91,13 +91,11 @@ static const u32 crc32c_table[256] = {
  * crc using table.
  */
 
-u32 crc32c_le(u32 seed, unsigned char const *data, size_t length)
+u32 crc32c_le(u32 crc, unsigned char const *data, size_t length)
 {
-	u32 crc = (__force __u32)(cpu_to_le32(seed));
-	
 	while (length--)
 		crc =
 		    crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8);
 
-	return le32_to_cpu((__force __le32)crc);
+	return crc;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[ANNOUNCE] Btrfs v0.12 released, Chris Mason, (Wed Feb 6, 1:00 pm)
BTRFS only works with PAGE_SIZE &lt;= 4K, David Miller, (Tue Feb 12, 5:55 pm)
Re: BTRFS only works with PAGE_SIZE &lt;= 4K, Chris Mason, (Tue Feb 12, 6:03 pm)
CRC32C big endian bugs..., David Miller, (Tue Feb 12, 5:23 am)
BTRFS partition usage..., David Miller, (Tue Feb 12, 3:21 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 4:11 am)
Re: BTRFS partition usage..., Chris Mason, (Tue Feb 12, 9:49 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 4:50 pm)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 10:00 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 7:28 pm)
Re: BTRFS partition usage..., Theodore Tso, (Tue Feb 12, 8:45 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 7:26 pm)
Re: BTRFS partition usage..., Bryan Henderson, (Tue Feb 12, 9:25 pm)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 7:39 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 9:08 pm)
Re: BTRFS partition usage..., Chris Mason, (Tue Feb 12, 10:08 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 7:33 pm)
Re: BTRFS partition usage..., Jeff Garzik, (Tue Feb 12, 10:10 pm)
Re: BTRFS partition usage..., Szabolcs Szakacsits, (Wed Feb 13, 8:51 pm)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 10:21 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 7:34 pm)
Re: BTRFS partition usage..., Chris Mason, (Tue Feb 12, 10:35 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 7:35 pm)
Re: BTRFS partition usage..., Christoph Hellwig, (Wed Feb 13, 3:02 am)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 11:04 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 7:38 pm)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 7:42 pm)
Re: BTRFS partition usage..., Rene Herman, (Tue Feb 12, 9:22 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 9:09 pm)
Re: BTRFS partition usage..., Chris Mason, (Tue Feb 12, 12:17 pm)
Re: [ANNOUNCE] Btrfs v0.12 released, David Miller, (Sun Feb 10, 9:12 pm)
Re: [ANNOUNCE] Btrfs v0.12 released, Chris Mason, (Mon Feb 11, 9:42 am)
Re: [ANNOUNCE] Btrfs v0.12 released, David Miller, (Tue Feb 12, 2:43 am)
Re: [ANNOUNCE] Btrfs v0.12 released, Chris Mason, (Tue Feb 12, 9:43 am)