Re: [virtio-dev] virtio-blk: the nature of discard_sector_alignment

From
Paolo Bonzini <>
Date
2019-02-22T09:21:58+00:00
ID
Thread
Re: [virtio-dev] virtio-blk: the nature of discard_sector_alignment
On 21/02/19 17:38, Jakub Jermar wrote:
> 
> my device enforces the discard_sector_alignment on the request (both
> sector and num_sectors), but for some reason the blkdiscard command and
> Linux driver issue requests that do not honor this alignment.
> 
> Does discard_sector_alignment represent a strict requirement that must
> be always honored or is it rather a hint to the driver?

It's a hint that misaligned requests might not result in any discard
happening at all.

> The wording in the spec seems to be more lenient while in Linux the
> field is documented rather strictly:
The spec is correct.

Paolo