Handle 32-bit overflows in disk utilization stats
authorAlexey Neyman <aneyman@google.com>
Tue, 3 Oct 2023 22:49:02 +0000 (22:49 +0000)
committerAlexey Neyman <aneyman@google.com>
Thu, 5 Oct 2023 18:45:43 +0000 (18:45 +0000)
commit5f7bd351630d02c223772ade57bf321a75fba020
treef2cb1da54085279bc4d9c187c961fd1cce86c70d
parent4b3d7ff7216dfdb1708cc8ad1b267186440eac11
Handle 32-bit overflows in disk utilization stats

Linux prints [1] some of the values reported in block device's `stat`
sysfs file as 32-bit unsigned integers. fio interprets them as 64-bit
integers when reading that sysfs file and performs further arithmetics
on them in 64-bits. If the reported value overflows during fio run,
a huge bogus value is reported in the "disk utilization" block instead.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/block/genhd.c#n962

Signed-off-by: Alexey Neyman <aneyman@google.com>
diskutil.c