io_u: fix trimming of mixed block size randommap
authorJens Axboe <axboe@kernel.dk>
Tue, 12 Sep 2017 20:02:34 +0000 (14:02 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 12 Sep 2017 20:02:34 +0000 (14:02 -0600)
commit956e60eade2bddb8aadfb54b58030e0b88fd03b2
tree36ea3afddfede610176e5b6ea59e0f29e3c53fbe
parentc6fa271e32f08f35d7fc25272e77c0f7ee17bfec
io_u: fix trimming of mixed block size randommap

If you run something ala:

fio --name=test --filename=/dev/sda --rw=randread --size=1M --bs=128k,64k --ioengine=libaio --io_submit_mode=offload

where the you have different block sizes for reads and writes, we can
get into a situation where we have to trim IO size for a read
(128k bs), but we use the general minimum block size, which is 64k
That results in a case where we incorrectly reset the IO size to
0, resulting in an invalid IO.

Fixes: https://github.com/axboe/fio/issues/458
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_u.c