io_uring: fix possible infinite loop
authorSatoru Takeuchi <sat@cybozu.co.jp>
Sun, 5 May 2019 23:56:36 +0000 (08:56 +0900)
committerSatoru Takeuchi <sat@cybozu.co.jp>
Sun, 5 May 2019 23:56:36 +0000 (08:56 +0900)
When reaping some completed I/O before io_uring_enter(), it waits forever.

Signed-off-by: Satoru Takeuchi <sat@cybozu.co.jp>
engines/io_uring.c

index 5b3509a..a5e77d8 100644 (file)
@@ -233,6 +233,8 @@ static int fio_ioring_getevents(struct thread_data *td, unsigned int min,
                r = fio_ioring_cqring_reap(td, events, max);
                if (r) {
                        events += r;
+                       if (actual_min != 0)
+                               actual_min -= r;
                        continue;
                }