X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.c;h=61aabb301d35e4abacbd070f9b528122d8fd3de8;hp=ebe06d66f1ed1131e472ff2d0515acf6ed7b443c;hb=refs%2Ftags%2Ffio-1.27.3;hpb=1621031e8a7cbb91afad124da405fc4eabda764f diff --git a/fio.c b/fio.c index ebe06d66..61aabb30 100644 --- a/fio.c +++ b/fio.c @@ -186,6 +186,9 @@ static int __check_min_rate(struct thread_data *td, struct timeval *now, unsigned int rate_iops = 0; unsigned int rate_iops_min = 0; + if (!td->o.ratemin[ddir] && !td->o.rate_iops_min[ddir]) + return 0; + /* * allow a 2 second settle period in the beginning */ @@ -1041,7 +1044,7 @@ static void *thread_main(void *data) memcpy(&td->ts.stat_sample_time, &td->start, sizeof(td->start)); memcpy(&td->tv_cache, &td->start, sizeof(td->start)); - if (td->o.ratemin) + if (td->o.ratemin[0] || td->o.ratemin[1]) memcpy(&td->lastrate, &td->ts.stat_sample_time, sizeof(td->lastrate)); @@ -1368,8 +1371,12 @@ static void run_threads(void) * its own files. so close them, if we opened them * for creation */ - for_each_file(td, f, i) - td_io_close_file(td, f); + for_each_file(td, f, i) { + if (fio_file_open(f)) + td_io_close_file(td, f); + else + assert(f->fd == -1); + } } init_disk_util(td);