libblkid: Compute CRC with sb_crc zeroed
The Linux kernel computes the sb_crc by crcing the
superblock with the CRC field set to 0. The code is
trying to avoid doing this in three separate CRC calls
like the kernel performs by simply zeroing the field
and making a single call.
Except that the passed copy "ondisk" isn't the same
as the returned copy "csummed" so the zeroing goes into
the wrong buffer. Meaning that the CRC is computed
incorrectly. This results in blkid returning:
/dev/sda4: PARTUUID="
2f162043-63c2-d145-869b-
e53f9db57476"
rather than:
/dev/sda4: UUID="
45b931b7-592a-46dc-9c33-
d38d5901ec29" BLOCK_SIZE="4096" TYPE="xfs" PARTUUID="
2f162043-63c2-d145-869b-
e53f9db57476"
Which can result in lots of failures including boot
failures if XFS modules aren't placed into the initrd,
or scripts/etc cannot determine the fs UUID.
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>