HomeFreeBSD

Enable encrypted raw sending to pools with greater ashift

Description

Enable encrypted raw sending to pools with greater ashift

Raw sending from pool1/encrypted with ashift=9 to pool2/encrypted with
ashift=12 results to failure when mounting pool2/encrypted (Input/Output
error). Notably, the opposite, raw sending from a greater ashift to a
lower one does not fail.

This happens because zio_compress_write() falsely checks only
ZIO_FLAG_RAW_COMPRESS and not ZIO_FLAG_RAW_ENCRYPT which is also set in
encrypted raw send streams. In this case it rounds up the psize and if
not equal to the zio->io_size it modifies the block by zeroing out
the extra bytes. Because this happens in a SA attr. registration object
(type=46), the decryption fails upon mounting the filesystem, and zpool
status falsely reports an error.

Fix this by checking both ZIO_FLAG_RAW_COMPRESS and ZIO_FLAG_RAW_ENCRYPT
before deciding whether to zero-pad a block.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #13067
Closes #13074

Details

Provenance
g_amanakis_yahoo.comAuthored on Feb 16 2022, 7:52 PM
Tony Hutter <hutter2@llnl.gov>Committed on Feb 24 2022, 12:47 AM
Parents
rG6c6153e5b80d: Avoid dirtying the final TXGs when exporting a pool
Branches
Unknown
Tags
Unknown