Fix infinite loop in get_next_file_rr()
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 5f51a00e2457e4880468c8dc2b21ce4da93a39b3..691f7afe36cd9b2ffa5072b265b446c685a6264e 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -446,8 +446,10 @@ static struct fio_file *get_next_file_rr(struct thread_data *td, int goodf,
                if (td->next_file >= td->o.nr_files)
                        td->next_file = 0;
 
-               if (f->flags & FIO_FILE_DONE)
+               if (f->flags & FIO_FILE_DONE) {
+                       f = NULL;
                        continue;
+               }
 
                if ((!goodf || (f->flags & goodf)) && !(f->flags & badf))
                        break;