Do at least one block if randommap fails us
authorJens Axboe <jens.axboe@oracle.com>
Mon, 2 Jun 2008 08:15:48 +0000 (10:15 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 2 Jun 2008 08:15:48 +0000 (10:15 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
io_u.c

diff --git a/io_u.c b/io_u.c
index c33dddf66f7c1337ed9157ffe5ad52628703945d..927e161177d97ead31a03c44f436086ea5103f06 100644 (file)
--- 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);