On 2014-10-09 09:20, Andrey Kuzmin wrote:
And how about this one?

index 7c3a42a..12f3b36 100644
--- a/engines/libaio.c
+++ b/engines/libaio.c
@@ -165,9 +165,9 @@ static int fio_libaio_getevents(struct thread_data
*td, unsigned int min,
                         r = io_getevents(ld->aio_ctx, actual_min,
                                 max, ld->aio_events + events, lt);
                 }
-               if (r >= 0)
+               if (r > 0)
                         events += r;
-               else if (r == -EAGAIN) {
+               else if ((min && r == 0) || r == -EAGAIN) {
                         fio_libaio_commit(td);
                         usleep(100);
                 } else if (r != -EINTR)

Yeah, this looks better.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to