Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable encrypted raw sending to pools with greater ashift #13074

Merged
merged 1 commit into from
Feb 16, 2022

Commits on Feb 16, 2022

  1. 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.
    
    Signed-off-by: George Amanakis <gamanakis@gmail.com>
    gamanakis committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    7b29f73 View commit details
    Browse the repository at this point in the history