Michael S. Tsirkin
2022-Sep-29 07:20 UTC
[PATCH v3] virtio_blk: add SECURE ERASE command support
On Thu, Sep 29, 2022 at 10:13:47AM +0300, Alvaro Karsz wrote:> > Could you explain this last part? Why are they used without > > VIRTIO_BLK_F_DISCARD? > > > Sure, > > If both VIRTIO_BLK_F_DISCARD and VIRTIO_BLK_F_SECURE_ERASE are negotiated: > q->limits.max_discard_segments > min(virtio_blk_config->max_discard_seg, > virtio_blk_config->max_secure_erase_seg) > > If VIRTIO_BLK_F_DISCARD is negotiated and VIRTIO_BLK_F_SECURE_ERASE isn't > q->limits.max_discard_segments = virtio_blk_config->max_discard_seg > > If VIRTIO_BLK_F_SECURE_ERASE is negotiated and VIRTIO_BLK_F_DISCARD isn't > q->limits.max_discard_segments = virtio_blk_config->max_secure_erase_segOK so virtio_blk_config->max_discard_seg is unused without VIRTIO_BLK_F_DISCARD. -- MST
Alvaro Karsz
2022-Sep-29 07:29 UTC
[PATCH v3] virtio_blk: add SECURE ERASE command support
> OK so virtio_blk_config->max_discard_seg is unused without > VIRTIO_BLK_F_DISCARD.Yes, if I understood the spec correctly, virtio_blk_config->max_discard_seg is relevant if VIRTIO_BLK_F_DISCARD is negotiated, and virtio_blk_config->max_secure_erase_seg is relevant if VIRTIO_BLK_F_SECURE_ERASE is negotiated. What should I do? Should I fix the patch?