X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=b48c99dad3ed4a3eb25650de53f59203463af850;hp=17e188ad022ee05f3bb6dceedb153a24027b2fb3;hb=1020a139beff50faf1bb18f761b024b664a09e14;hpb=0401bca6b35ee32681462713ce9bc0cc2accbbf2 diff --git a/io_u.c b/io_u.c index 17e188ad..b48c99da 100644 --- a/io_u.c +++ b/io_u.c @@ -452,7 +452,7 @@ static struct fio_file *get_next_file(struct thread_data *td) assert(td->o.nr_files <= td->files_index); - if (!td->nr_open_files) + if (!td->nr_open_files || td->nr_done_files >= td->o.nr_files) return NULL; f = td->file_service_file; @@ -473,6 +473,9 @@ static struct fio_file *find_next_new_file(struct thread_data *td) { struct fio_file *f; + if (!td->nr_open_files || td->nr_done_files >= td->o.nr_files) + return NULL; + if (td->o.file_service_type == FIO_FSERVICE_RR) f = get_next_file_rr(td, 0, FIO_FILE_OPEN); else @@ -548,6 +551,7 @@ set_file: io_u->file = NULL; td_io_close_file(td, f); f->flags |= FIO_FILE_DONE; + td->nr_done_files++; /* * probably not the right place to do this, but see