From 0aacc50c2fa41e44512ce8eacfd3d679cb016d86 Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Sat, 9 Jul 2011 08:19:53 +0200 Subject: [PATCH] Fix integer overflow in calculating large IOPS on 32-bit platforms Signed-off-by: Jens Axboe --- stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stat.c b/stat.c index d95be758..9f22c6e1 100644 --- a/stat.c +++ b/stat.c @@ -169,7 +169,7 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts, io_p = num2str(ts->io_bytes[ddir], 6, 1, i2p); bw_p = num2str(bw, 6, 1, i2p); - iops = (1000 * ts->total_io_u[ddir]) / runt; + iops = (1000 * (uint64_t)ts->total_io_u[ddir]) / runt; iops_p = num2str(iops, 6, 1, 0); log_info(" %s: io=%sB, bw=%sB/s, iops=%s, runt=%6llumsec\n", -- 2.25.1