X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=3299f2907af47bb3e6d7b59d2c35aad004509df2;hp=599bf08d8a4594aa7f12b46c80ca585d67f3834a;hb=ea4cc0ea343ec355fafda1104623d3bdd306a5b6;hpb=e0a04ac15f6164cfceb3e1090cc1055e3c823f7d diff --git a/io_u.c b/io_u.c index 599bf08d..3299f290 100644 --- a/io_u.c +++ b/io_u.c @@ -553,7 +553,7 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u, buflen = bsp->bs; perc += bsp->perc; - if ((r <= ((frand_max / 100L) * perc)) && + if ((r * 100UL <= frand_max * perc) && io_u_fits(td, io_u, buflen)) break; } @@ -1667,7 +1667,7 @@ void io_u_log_error(struct thread_data *td, struct io_u *io_u) { __io_u_log_error(td, io_u); if (td->parent) - __io_u_log_error(td, io_u); + __io_u_log_error(td->parent, io_u); } static inline bool gtod_reduce(struct thread_data *td)