summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeff Moyer <jmoyer@redhat.com>2018-09-28 17:27:58 -0400
committerJens Axboe <axboe@kernel.dk>2018-09-30 08:15:50 -0600
commit2474b06db61072bcb027c8f3b309b8df3f74627c (patch)
tree9440a9908b787d285f66f8416c42e0d7b51200b3 /lib
parent91d2513127442c4946dc99978870c4dc4f58427d (diff)
downloadfio-2474b06db61072bcb027c8f3b309b8df3f74627c.tar.gz
fio-2474b06db61072bcb027c8f3b309b8df3f74627c.tar.bz2
fix hung fio process with large I/O sizes and verify= option
Hi, If you use a very large I/O size (1G in this instance), and also specify the verify option, fio will hang, using up 100% cpu, for ever and ever. The problem is that __fill_random_buf_percentage does math that overflows the size of an unsigned int. Fixing that gets fio to terminate as expected. Here is the job file which showed the problem: [global] ioengine=dev-dax direct=0 filename=/dev/dax0.0 verify=crc32c bs=1G [write] rw=write runtime=5 [read] stonewall rw=read runtime=5 Reported-by: sujith_pandel@dell.com Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib')
-rw-r--r--lib/rand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rand.c b/lib/rand.c
index 46ffe4fb..99846a8d 100644
--- a/lib/rand.c
+++ b/lib/rand.c
@@ -156,7 +156,7 @@ void __fill_random_buf_percentage(unsigned long seed, void *buf,
/*
* Fill random chunk
*/
- this_len = (segment * (100 - percentage)) / 100;
+ this_len = ((unsigned long long)segment * (100 - percentage)) / 100;
if (this_len > len)
this_len = len;