loader: zio_checksum_verify should check byteswap
We do have both native and byteswap checksum callbacks in place but the selection is not wired. MFC after: 1 week
This commit is contained in:
parent
cb5233f4fa
commit
33d5dc951f
@ -442,6 +442,13 @@ _NOTE(CONSTCOND) } while (0)
|
||||
ZIO_SET_CHECKSUM(&(bp)->blk_cksum, 0, 0, 0, 0); \
|
||||
}
|
||||
|
||||
#if BYTE_ORDER == _BIG_ENDIAN
|
||||
#define ZFS_HOST_BYTEORDER (0ULL)
|
||||
#else
|
||||
#define ZFS_HOST_BYTEORDER (1ULL)
|
||||
#endif
|
||||
|
||||
#define BP_SHOULD_BYTESWAP(bp) (BP_GET_BYTEORDER(bp) != ZFS_HOST_BYTEORDER)
|
||||
#define BPE_NUM_WORDS 14
|
||||
#define BPE_PAYLOAD_SIZE (BPE_NUM_WORDS * sizeof (uint64_t))
|
||||
#define BPE_IS_PAYLOADWORD(bp, wp) \
|
||||
|
@ -318,8 +318,9 @@ zio_checksum_verify(const spa_t *spa, const blkptr_t *bp, void *data)
|
||||
byteswap_uint64_array(&expected_cksum,
|
||||
sizeof (zio_cksum_t));
|
||||
} else {
|
||||
byteswap = BP_SHOULD_BYTESWAP(bp);
|
||||
expected_cksum = bp->blk_cksum;
|
||||
ci->ci_func[0](data, size, ctx, &actual_cksum);
|
||||
ci->ci_func[byteswap](data, size, ctx, &actual_cksum);
|
||||
}
|
||||
|
||||
if (!ZIO_CHECKSUM_EQUAL(actual_cksum, expected_cksum)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user