Merge branch 'fix-get-next-file' of https://github.com/aclamk/fio
authorJens Axboe <axboe@kernel.dk>
Tue, 29 Dec 2020 23:36:32 +0000 (16:36 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Dec 2020 23:36:32 +0000 (16:36 -0700)
* 'fix-get-next-file' of https://github.com/aclamk/fio:
  io_u: Fix bad interaction with --openfiles and non-sequential file selection policy

io_u.c

diff --git a/io_u.c b/io_u.c
index f30fc03701300e0b41f8a1be7c906a9eaa7996a1..00a219c2e85922906dd859583ef6f1ae31ad29c0 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1326,8 +1326,10 @@ static struct fio_file *__get_next_file(struct thread_data *td)
        if (f && fio_file_open(f) && !fio_file_closing(f)) {
                if (td->o.file_service_type == FIO_FSERVICE_SEQ)
                        goto out;
-               if (td->file_service_left--)
-                       goto out;
+               if (td->file_service_left) {
+                 td->file_service_left--;
+                 goto out;
+               }
        }
 
        if (td->o.file_service_type == FIO_FSERVICE_RR ||