From 2bce52c621f0e1d7a360e8aedfe23300f8e56bb9 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 30 Sep 2018 08:41:40 -0600 Subject: [PATCH] engines/cpu: fix potential overflow in thinktime calculation Signed-off-by: Jens Axboe --- engines/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/cpu.c b/engines/cpu.c index 09872508..4d572b44 100644 --- a/engines/cpu.c +++ b/engines/cpu.c @@ -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; -- 2.25.1