linux-stable/drivers/block
Christoph Hellwig 74f1add542 virtio_blk: fix the discard_granularity and discard_alignment queue limits
[ Upstream commit 62952cc5bc ]

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: 1f23816b8e ("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:25:46 +02:00
..
aoe aoe: remove redundant assignment on variable n 2022-01-13 13:00:45 -07:00
drbd drbd: fix duplicate array initializer 2022-06-09 10:25:40 +02:00
mtip32xx block: fix surprise removal for drivers calling blk_set_queue_dying 2022-02-17 07:54:03 -07:00
null_blk block: null_blk: end timed out poll request 2022-04-20 09:36:18 +02:00
paride Char/Misc and other driver changes for 5.17-rc1 2022-01-14 16:02:28 +01:00
rnbd bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
xen-blkback block: remove GENHD_FL_CD 2021-11-29 06:35:21 -07:00
zram Merge branch 'akpm' (patches from Andrew) 2022-01-15 20:37:06 +02:00
amiflop.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
ataflop.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
brd.c brd: remove brd_devices_mutex mutex 2022-01-17 07:19:40 -07:00
floppy.c floppy: use a statically allocated error counter 2022-05-25 09:58:56 +02:00
Kconfig floppy: disable FDRAWCMD by default 2022-05-09 09:16:11 +02:00
loop.c loop: fix ioctl calls using compat_loop_info 2022-04-08 13:58:55 +02:00
loop.h loop: revert "make autoclear operation asynchronous" 2022-02-11 05:51:23 -07:00
Makefile block: remove the rsxx driver 2021-12-16 10:57:04 -07:00
n64cart.c n64cart: convert bi_disk to bi_bdev->bd_disk fix build 2022-04-08 13:59:04 +02:00
nbd.c nbd: Fix hung on disconnect request if socket is closed before 2022-06-09 10:25:28 +02:00
pktcdvd.c pktcdvd: convert to use attribute groups 2022-01-03 21:24:34 -07:00
ps3disk.c ps3disk: add error handling support for add_disk() 2021-10-30 11:03:37 -06:00
ps3vram.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
rbd.c block: fix surprise removal for drivers calling blk_set_queue_dying 2022-02-17 07:54:03 -07:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
sunvdc.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
swim.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
swim3.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
swim_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
sx8.c block: remove the gendisk argument to blk_execute_rq 2021-11-29 06:41:29 -07:00
virtio_blk.c virtio_blk: fix the discard_granularity and discard_alignment queue limits 2022-06-09 10:25:46 +02:00
xen-blkfront.c xen/blkfront: don't use gnttab_query_foreign_access() for mapped status 2022-03-07 09:48:54 +01:00
z2ram.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00