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>
*/
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;