From 956e60eade2bddb8aadfb54b58030e0b88fd03b2 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 12 Sep 2017 14:02:34 -0600 Subject: [PATCH] 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 --- io_u.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.25.1