X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Ffio-engine-libaio.c;h=57daf1b6b49a5c8b2933eac060b025318594803e;hp=c3fefdaccda7ea97cf660c0db4007b158807310e;hb=84585003d025a38b91749cb0d68f6b5653d1f1a3;hpb=7313b48c3196b4750f4103e8622126039e2231c6;ds=sidebyside diff --git a/engines/fio-engine-libaio.c b/engines/fio-engine-libaio.c index c3fefdac..57daf1b6 100644 --- a/engines/fio-engine-libaio.c +++ b/engines/fio-engine-libaio.c @@ -55,7 +55,7 @@ static int fio_libaio_getevents(struct thread_data *td, int min, int max, continue; } else if (r == -EINTR) continue; - else + else if (r != 0) break; } while (1); @@ -72,7 +72,7 @@ static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u) ret = io_submit(ld->aio_ctx, 1, &iocb); if (ret == 1) return 0; - else if (ret == -EAGAIN) + else if (ret == -EAGAIN || !ret) usleep(100); else if (ret == -EINTR) continue; @@ -80,8 +80,9 @@ static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u) break; } while (1); - return (int) ret; + assert(ret); + return (int) ret; } static int fio_libaio_cancel(struct thread_data *td, struct io_u *io_u) @@ -116,6 +117,7 @@ static int fio_libaio_init(struct thread_data *td) } ld->aio_events = malloc(td->iodepth * sizeof(struct io_event)); + memset(ld->aio_events, 0, td->iodepth * sizeof(struct io_event)); td->io_ops->data = ld; return 0; }