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>
master
David Sterba 2013-05-06 22:01:51 +00:00 committed by Chris Mason
parent 14e028c26b
commit 5e82da1118
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}