[dm-devel] [PATCH v2 0/3] Fix dm-crypt zoned block device support
Mikulas Patocka
mpatocka at redhat.com
Mon Apr 19 13:52:31 BST 2021
On Sat, 17 Apr 2021, Damien Le Moal wrote:
> Mike,
>
> Zone append BIOs (REQ_OP_ZONE_APPEND) always specify the start sector
> of the zone to be written instead of the actual location sector to
> write. The write location is determined by the device and returned to
> the host upon completion of the operation.
I'd like to ask what's the reason for this semantics? Why can't users of
the zoned device supply real sector numbers?
> 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 is
> encrypted using an IV calculated from 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. Reads fail in that
> case.
I would say that it is incompatible with all dm targets - even the linear
target is changing the sector number and so it may redirect the write
outside of the range specified in dm-table and cause corruption.
Instead of complicating device mapper with imperfect support, I would just
disable REQ_OP_ZONE_APPEND on device mapper at all.
Mikulas
More information about the Linux-nvme
mailing list