From: Jens Axboe Date: Mon, 2 Jun 2008 08:15:48 +0000 (+0200) Subject: Do at least one block if randommap fails us X-Git-Tag: fio-1.21-rc4~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=8b113b4f2975f9edf4542d2e0f6d876dd89d1b8c;hp=c9dd34b291ad747804040cb2bb60127e6afcc3fa Do at least one block if randommap fails us Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index c33dddf6..927e1611 100644 --- a/io_u.c +++ b/io_u.c @@ -57,8 +57,11 @@ static void mark_random_map(struct thread_data *td, struct io_u *io_u) * If we have a mixed random workload, we may * encounter blocks we already did IO to. */ - if ((td->o.ddir_nr == 1) && !random_map_free(f, block)) + if ((td->o.ddir_nr == 1) && !random_map_free(f, block)) { + if (!blocks) + blocks = 1; break; + } idx = RAND_MAP_IDX(f, block); bit = RAND_MAP_BIT(f, block);