From: Andrzej Jakowski Date: Wed, 11 Oct 2017 22:26:00 +0000 (-0600) Subject: Fix overflow in percentile calculation for Windows X-Git-Tag: fio-3.2~31 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=447b94e10bddab8078f35c423ca1e3c3f0b1be38;ds=sidebyside Fix overflow in percentile calculation for Windows This patch fixes percentile calculation for Windows where overflow on 32 bit type happened while calculating actual percentiles. Signed-off-by: Andrzej Jakowski Signed-off-by: Jens Axboe --- diff --git a/stat.c b/stat.c index c5a68ad5..5c758680 100644 --- a/stat.c +++ b/stat.c @@ -139,7 +139,7 @@ unsigned int calc_clat_percentiles(unsigned int *io_u_plat, unsigned long nr, fio_fp64_t *plist, unsigned long long **output, unsigned long long *maxv, unsigned long long *minv) { - unsigned long sum = 0; + unsigned long long sum = 0; unsigned int len, i, j = 0; unsigned int oval_len = 0; unsigned long long *ovals = NULL;