libblkid: diffs between errors and failed probing in silicon raid

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: diffs between errors and failed probing in via raid

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: don't interpret regual XFS as external xfs log

 $ blkid -o udev -p tests/output/blkid/images-fs/xfs.img
 ID_FS_AMBIVALENT=filesystem:xfs other:xfs_external_log

it seems that regular XFS with internal log may be interpreted as log
device. This is incorrect.

This patch checks for XFS magic string to avoid this collision.

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: don't use UUID= for xfs external log

The log UUID is usually the same as filesystem UUID, it is bad idea to
have two devices with the same UUID in the system. It seems batter to
use only LOGUUID= for xfs external log.

 # mkfs.xfs -l logdev=/dev/sdb1 /dev/sdb2

 # blkid -p -o udev /dev/sdb1 | grep FS
 ID_FS_LOGUUID=4063d453-5c01-46ce-b92f-9523d64aecc7
 ID_FS_TYPE=xfs_external_log
 ID_FS_USAGE=other

 # blkid -p -o udev /dev/sdb2 | grep FS
 ID_FS_UUID=4063d453-5c01-46ce-b92f-9523d64aecc7
 ID_FS_TYPE=xfs
 ID_FS_USAGE=filesystem

The filesystem (sdb2) uses UUID= and log (sdb1) uses LOGUUID=.

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: add XFS log image

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: refresh jbd blkid test

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: use stable MBR ID

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: use separate function to verify checksums

 * consolidate "incorrect checksum" debug messages
 * verify all on one place

Based on patch from Gabriel de Perthuis <g2p.code@gmail.com>

Signed-off-by: Karel Zak <kzak@redhat.com>
wipefs: Also wipe superblocks with bad checksums

[kzak@redhat.com: - move BLKID_SUBLKS_BADCSUM login to
                    blkid_probe_verify_csum()]

Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
lib: add crc64()

Based on bcache code from Rolf Fokkens.

Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid: Add bcache support

From https://bugzilla.redhat.com/show_bug.cgi?id=1001120#c11

[kzak@redhat.com: - move crc64 code to lib/ by separate patch,
                  - use BLKID_USAGE_OTHER rather than _RAID]

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: add bcache images

 images generated by Rolf Fokkens <rolf@rolffokkens.nl>

Signed-off-by: Karel Zak <kzak@redhat.com>