Christoph Hellwig bd85a268bf virtio_blk: fix the discard_granularity and discard_alignment queue limits
[ Upstream commit 62952cc5bccd89b76d710de1d0b43244af0f2903 ]

The discard_alignment queue limit is named a bit misleading means the
offset into the block device at which the discard granularity starts.

On the other hand the discard_sector_alignment from the virtio 1.1 looks
similar to what Linux uses as discard granularity (even if not very well
described):

  "discard_sector_alignment can be used by OS when splitting a request
   based on alignment. "

And at least qemu does set it to the discard granularity.

So stop setting the discard_alignment and use the virtio
discard_sector_alignment to set the discard granularity.

Fixes: 1f23816b8eb8 ("virtio_blk: add discard and write zeroes support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220418045314.360785-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:22:53 +02:00
..
2021-06-30 12:21:16 -07:00
2021-09-02 15:09:46 -07:00
2021-06-30 12:21:16 -07:00
2021-10-17 06:51:19 -06:00
2022-05-01 17:22:22 +02:00
2021-09-03 22:14:40 -06:00
2021-03-24 06:57:40 -06:00
2021-08-02 13:37:27 -06:00
2021-08-16 10:50:33 -06:00
2021-06-11 11:53:02 -06:00
2021-06-30 12:21:16 -07:00