Commit d369735
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: [email protected]
Fixes: 71f28f3 ("ublk_drv: add io_uring based userspace block driver")
Signed-off-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent b2113ed commit d369735
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
672 | 677 | | |
673 | 678 | | |
674 | 679 | | |
675 | 680 | | |
676 | | - | |
677 | | - | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
678 | 687 | | |
679 | 688 | | |
680 | 689 | | |
| |||
1358 | 1367 | | |
1359 | 1368 | | |
1360 | 1369 | | |
1361 | | - | |
| 1370 | + | |
1362 | 1371 | | |
1363 | 1372 | | |
1364 | 1373 | | |
| |||
0 commit comments