linux/drivers/block
Ming Lei d369735e02 ublk: fix ublk_ch_mmap() for 64K page size
In ublk_ch_mmap(), queue id is calculated in the following way:

	(vma->vm_pgoff << PAGE_SHIFT) / `max_cmd_buf_size`

'max_cmd_buf_size' is equal to

	`UBLK_MAX_QUEUE_DEPTH * sizeof(struct ublksrv_io_desc)`

and UBLK_MAX_QUEUE_DEPTH is 4096 and part of UAPI, so 'max_cmd_buf_size'
is always page aligned in 4K page size kernel. However, it isn't true in
64K page size kernel.

Fixes the issue by always rounding up 'max_cmd_buf_size' with PAGE_SIZE.

Cc: stable@vger.kernel.org
Fixes: 71f28f3136 ("ublk_drv: add io_uring based userspace block driver")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241111110718.1394001-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-11-11 08:16:17 -07:00
..
aoe block-6.12-20241004 2024-10-04 10:43:44 -07:00
drbd block-6.12-20241018 2024-10-18 15:53:00 -07:00
mtip32xx mtip32xx: Replace deprecated PCI functions 2024-11-06 07:54:50 -07:00
null_blk Revert "block: pre-calculate max_zone_append_sectors" 2024-11-07 05:45:34 -07:00
rnbd block/rnbd-srv: Add sanity check and remove redundant assignment 2024-08-28 08:50:35 -06:00
xen-blkback xen/blkback: add missing MODULE_DESCRIPTION() macro 2024-07-10 00:21:18 -06:00
zram zram: don't free statically defined names 2024-09-26 14:01:44 -07:00
amiflop.c Merge branch 'for-6.11/block-limits' into for-6.11/block 2024-06-19 08:14:49 -06:00
ataflop.c Merge branch 'for-6.11/block-limits' into for-6.11/block 2024-06-19 08:14:49 -06:00
brd.c brd: defer automatic disk creation until module initialization succeeds 2024-10-30 07:31:07 -06:00
floppy.c floppy: add missing MODULE_DESCRIPTION() macro 2024-07-10 00:22:03 -06:00
Kconfig rust: block: add rnull, Rust null_blk implementation 2024-06-14 07:45:04 -06:00
loop.c loop: fix type of block size 2024-11-09 20:05:33 -07:00
Makefile rust: block: add rnull, Rust null_blk implementation 2024-06-14 07:45:04 -06:00
n64cart.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
nbd.c nbd: correct the maximum value for discard sectors 2024-09-06 08:31:40 -06:00
pktcdvd.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ps3disk.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
ps3vram.c block: pass a queue_limits argument to blk_alloc_disk 2024-02-19 16:58:23 -07:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
rbd.c rbd: unfreeze queue after marking disk as dead 2024-11-07 16:27:22 -07:00
rnull.rs rust: block: add rnull, Rust null_blk implementation 2024-06-14 07:45:04 -06:00
sunvdc.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
swim3.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
swim_asm.S
swim.c block: move the nonrot flag to queue_limits 2024-06-19 07:58:28 -06:00
ublk_drv.c ublk: fix ublk_ch_mmap() for 64K page size 2024-11-11 08:16:17 -07:00
virtio_blk.c Revert "block: pre-calculate max_zone_append_sectors" 2024-11-07 05:45:34 -07:00
xen-blkfront.c xen-blkfront: fix sector_size propagation to the block layer 2024-07-02 08:58:12 -06:00
z2ram.c z2ram: add missing MODULE_DESCRIPTION() macro 2024-06-19 07:54:00 -06:00