CRC32C big endian bugs...

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Miller
Date: Tuesday, February 12, 2008 - 2: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, 10:00 am)
Re: [ANNOUNCE] Btrfs v0.12 released, David Miller, (Sun Feb 10, 6:12 pm)
Re: [ANNOUNCE] Btrfs v0.12 released, Chris Mason, (Mon Feb 11, 6:42 am)
Re: [ANNOUNCE] Btrfs v0.12 released, David Miller, (Mon Feb 11, 11:43 pm)
BTRFS partition usage..., David Miller, (Tue Feb 12, 12:21 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 1:11 am)
CRC32C big endian bugs..., David Miller, (Tue Feb 12, 2:23 am)
Re: [ANNOUNCE] Btrfs v0.12 released, Chris Mason, (Tue Feb 12, 6:43 am)
Re: BTRFS partition usage..., Chris Mason, (Tue Feb 12, 6:49 am)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 7:00 am)
Re: BTRFS partition usage..., Chris Mason, (Tue Feb 12, 7:08 am)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 7:21 am)
Re: BTRFS partition usage..., Chris Mason, (Tue Feb 12, 7:35 am)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 8:04 am)
Re: BTRFS partition usage..., Chris Mason, (Tue Feb 12, 9:17 am)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 1:50 pm)
BTRFS only works with PAGE_SIZE <= 4K, David Miller, (Tue Feb 12, 2:55 pm)
Re: BTRFS only works with PAGE_SIZE <= 4K, Chris Mason, (Tue Feb 12, 3:03 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 4:26 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 4:28 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 4:33 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 4:34 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 4:35 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 4:38 pm)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 4:39 pm)
Re: BTRFS partition usage..., Jan Engelhardt, (Tue Feb 12, 4:42 pm)
Re: BTRFS partition usage..., Theodore Tso, (Tue Feb 12, 5:45 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 6:08 pm)
Re: BTRFS partition usage..., David Miller, (Tue Feb 12, 6:09 pm)
Re: BTRFS partition usage..., Rene Herman, (Tue Feb 12, 6:22 pm)
Re: BTRFS partition usage..., Bryan Henderson, (Tue Feb 12, 6:25 pm)
Re: BTRFS partition usage..., Jeff Garzik, (Tue Feb 12, 7:10 pm)
Re: BTRFS partition usage..., Christoph Hellwig, (Wed Feb 13, 12:02 am)
Re: BTRFS partition usage..., Szabolcs Szakacsits, (Wed Feb 13, 5:51 pm)