engines/cpu: fix potential overflow in thinktime calculation
authorJens Axboe <axboe@kernel.dk>
Sun, 30 Sep 2018 14:41:40 +0000 (08:41 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 30 Sep 2018 14:41:40 +0000 (08:41 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/cpu.c

index 09872508e12129d1408040eadb40055c0ebb8181..4d572b441a54921541e5d7e27ae8151c1dc4a2ce 100644 (file)
@@ -85,7 +85,7 @@ static int fio_cpuio_init(struct thread_data *td)
         */
        o->thinktime_blocks = 1;
        o->thinktime_spin = 0;
-       o->thinktime = (co->cpucycle * (100 - co->cpuload)) / co->cpuload;
+       o->thinktime = ((unsigned long long) co->cpucycle * (100 - co->cpuload)) / co->cpuload;
 
        o->nr_files = o->open_files = 1;