projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5b351d
)
backend: fix potential division-by-zero
author
Jens Axboe
<axboe@fb.com>
Tue, 15 Apr 2014 14:26:57 +0000
(08:26 -0600)
committer
Jens Axboe
<axboe@fb.com>
Tue, 15 Apr 2014 14:26:57 +0000
(08:26 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c
patch
|
blob
|
blame
|
history
diff --git
a/backend.c
b/backend.c
index 62bca29194ed08a80af9c68afdc1fbda75b164ef..12e562b2a369fc9338001d7b8e8f4254704bf4f6 100644
(file)
--- a/
backend.c
+++ b/
backend.c
@@
-204,7
+204,11
@@
static int __check_min_rate(struct thread_data *td, struct timeval *now,
td->o.name, rate_iops);
return 1;
} else {
- rate = ((iops - td->rate_blocks[ddir]) * 1000) / spent;
+ if (spent)
+ rate = ((iops - td->rate_blocks[ddir]) * 1000) / spent;
+ else
+ rate = 0;
+
if (rate < rate_iops_min ||
iops < td->rate_blocks[ddir]) {
log_err("%s: min iops rate %u not met,"