Add/correct missing command line options in help text
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 8f10bfdc0ce3552d1a1f7ccd6f1cdc613bf4ad73..9ab33f39da6cec4eb2fb2ae3c29e961660020438 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -44,7 +44,7 @@ static void mark_random_map(struct thread_data *td, struct io_u *io_u)
        unsigned int blocks;
        unsigned int nr_blocks;
 
-       block = io_u->offset / (unsigned long long) min_bs;
+       block = (io_u->offset - f->file_offset) / (unsigned long long) min_bs;
        blocks = 0;
        nr_blocks = (io_u->buflen + min_bs - 1) / min_bs;
 
@@ -55,7 +55,7 @@ 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(td, f, block))
+               if ((td->o.ddir_nr == 1) && !random_map_free(td, f, block))
                        break;
 
                idx = RAND_MAP_IDX(td, f, block);