summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2013-05-06 22:01:51 +0000
committerChris Mason <chris.mason@fusionio.com>2013-05-10 10:55:22 -0400
commit5e82da1118203d5ab92de3efccc1904b9e24766f (patch)
treee7983a01ab056f91967acc11c52d3133d4af62c9
parent14e028c26b6681e4a8423d79d965e2513e40cab9 (diff)
btrfs-progs: fix typecast when printing csum value
Only the first byte of the wanted csum is printed: checksum verify failed on 65536 found DA97CF61 wanted 6B checksum verify failed on 65536 found DA97CF61 wanted 6BC3870D Also add leading zeros to the format. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--disk-io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/disk-io.c b/disk-io.c
index b001e35a..21b410d3 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -89,9 +89,9 @@ int csum_tree_block_size(struct extent_buffer *buf, u16 csum_size,
if (verify) {
if (memcmp_extent_buffer(buf, result, 0, csum_size)) {
- printk("checksum verify failed on %llu found %X "
- "wanted %X\n", (unsigned long long)buf->start,
- *((int *)result), *((char *)buf->data));
+ printk("checksum verify failed on %llu found %08X "
+ "wanted %08X\n", (unsigned long long)buf->start,
+ *((u32 *)result), *((u32*)(char *)buf->data));
free(result);
return 1;
}