From 8b113b4f2975f9edf4542d2e0f6d876dd89d1b8c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 2 Jun 2008 10:15:48 +0200 Subject: [PATCH] Do at least one block if randommap fails us Signed-off-by: Jens Axboe --- io_u.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.25.1