X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=io_u.c;h=bee99c3798d8474afcfaaa71a0bc8d1a0c7de2d8;hb=d63a472d4b213533236ae9aab9cf9e0ec2854c31;hp=d28d368f694916683ad05ad34f7fa446d3c11e89;hpb=d28174f0189cd862bc7480e5dc8314fd8257ffd2;p=fio.git diff --git a/io_u.c b/io_u.c index d28d368f..bee99c37 100644 --- a/io_u.c +++ b/io_u.c @@ -570,8 +570,10 @@ static unsigned long long get_next_buflen(struct thread_data *td, struct io_u *i power_2 = is_power_of_2(minbs); if (!td->o.bs_unaligned && power_2) buflen &= ~(minbs - 1); - else if (!td->o.bs_unaligned && !power_2) - buflen -= buflen % minbs; + else if (!td->o.bs_unaligned && !power_2) + buflen -= buflen % minbs; + if (buflen > maxbs) + buflen = maxbs; } while (!io_u_fits(td, io_u, buflen)); return buflen; @@ -1559,9 +1561,8 @@ again: assert(!(td->flags & TD_F_CHILD)); ret = pthread_cond_wait(&td->free_cond, &td->io_u_lock); assert(ret == 0); - if (td->error) - return NULL; - goto again; + if (!td->error) + goto again; } if (needs_lock)