From: Jens Axboe Date: Tue, 12 Sep 2017 20:02:34 +0000 (-0600) Subject: io_u: fix trimming of mixed block size randommap X-Git-Tag: fio-3.1~13 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=956e60eade2bddb8aadfb54b58030e0b88fd03b2 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 --- diff --git a/io_u.c b/io_u.c index db043e4a..e98cd318 100644 --- a/io_u.c +++ b/io_u.c @@ -37,7 +37,7 @@ static bool random_map_free(struct fio_file *f, const uint64_t block) */ static void mark_random_map(struct thread_data *td, struct io_u *io_u) { - unsigned int min_bs = td->o.rw_min_bs; + unsigned int min_bs = td->o.min_bs[io_u->ddir]; struct fio_file *f = io_u->file; unsigned int nr_blocks; uint64_t block;