diff --git a/ChangeLog b/ChangeLog index accdd4c67..4780ec1ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-08-22 Vladimir Serbinenko + + * include/grub/zfs/spa.h (zio_cksum): Add explicit members for mac. + * grub-core/fs/zfs/zfs.c (zio_read): Don't use casts to retrieve mac. + 2013-08-22 Vladimir Serbinenko * grub-core/kern/emu/mm.c (grub_memalign): Don't define if there is no diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index f4acfd827..7302b0af5 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -1871,7 +1871,7 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf, err = grub_zfs_decrypt (data->subvol.keyring[besti].cipher, data->subvol.keyring[besti].algo, &(bp)->blk_dva[encrypted], - compbuf, psize, ((grub_uint32_t *) &zc + 5), + compbuf, psize, zc.zc_mac, endian); } if (err) diff --git a/include/grub/zfs/spa.h b/include/grub/zfs/spa.h index 19a2b640a..7edb8ab7d 100644 --- a/include/grub/zfs/spa.h +++ b/include/grub/zfs/spa.h @@ -97,7 +97,15 @@ typedef struct dva { * Each block has a 256-bit checksum -- strong enough for cryptographic hashes. */ typedef struct zio_cksum { + union + { grub_uint64_t zc_word[4]; + struct + { + grub_uint32_t zc_cut_cksum[5]; + grub_uint32_t zc_mac[3]; + }; + }; } zio_cksum_t; /*