• Damien Le Moal's avatar
    dm crypt: Fix zoned block device support · f34ee1dc
    Damien Le Moal authored
    Zone append BIOs (REQ_OP_ZONE_APPEND) always specify the start sector
    of the zone to be written instead of the actual sector location to
    write. The write location is determined by the device and returned to
    the host upon completion of the operation. This interface, while simple
    and efficient for writing into sequential zones of a zoned block
    device, is incompatible with the use of sector values to calculate a
    cypher block IV. All data written in a zone end up using the same IV
    values corresponding to the first sectors of the zone, but read
    operation will specify any sector within the zone resulting in an IV
    mismatch between encryption and decryption.
    
    To solve this problem, report to DM core that zone append operations are
    not supported. This result in the zone append operations being emulated
    using regular write operations.
    Reported-by: default avatarShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
    Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
    Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
    Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    f34ee1dc
dm-crypt.c 93 KB