I've been hoping to use elements of the blkptr_t as the initalisation vector (IV) for the AES crypto algorithms - specifically the offset and blk_birth. When do these get filled in ?
I was expecting them to be filled in by the time we reached the ZIO_WRITE_ENCRYPT_STAGE (after compression but before checksum), but it appears that only blk_props is filled in at this point. So maybe I should be looking at io_txg instead. I need an IV that is guaranteed unique over the life time of the pool that is also unique per encryption key (which for phase 1 of zfs-crypto means unique per dataset). Since there could be multiple blocks being encrypted for the same dataset in a given transaction group (highly likely in fact) the txg alone is not enough. -- Darren J Moffat