fio: Fix (unsigned) integer overflow issues
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 20 Nov 2016 20:55:06 +0000 (20:55 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 27 Nov 2016 21:30:15 +0000 (21:30 +0000)
commit90eff1c9f01d2f8b4ff8bc75a2bf120a1789b37c
treeea9d25c549c79f5d2d88137e9dbd73a382270c7d
parent42f1ee68ceec87fbbfdc4972c35d3cdf7c08d9f6
fio: Fix (unsigned) integer overflow issues

This patch tries to address issues found when compiling fio with clang's
undefined behaviour sanitizer on 32 bit Linux. While this generated many
false positives it did identify a number of subtle issues when
rates/amounts/time calculations went above 32 bit values.

The following job was used:
[global]
time_based
runtime=180m
bs=256k
rw=randrw
norandommap
rate=512M
ioengine=null
direct=1
iodepth=8
thread
numjobs=10
ramp_time=20m

[null]
size=1P

It should fix https://github.com/axboe/fio/issues/270 because various 32
bit ETA variables were overflowing due to the microsecond arithmetic
being done on them (even on 64 bit systems).

This patch should also fix https://github.com/axboe/fio/issues/194 and
https://github.com/axboe/fio/issues/266 because 64 bit Windows is a
LLP64 platform so ints and longs still default to 32 bits.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
backend.c
cconv.c
client.c
eta.c
fio.h
gettime.c
io_u.c
mutex.c
server.c
stat.h
thread_options.h