[PATCH] ->queue() error handling
We return 1/0 for failure/success and put the error in io_u->error.
The libaio engine didn't quite do that.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/engines/fio-engine-libaio.c b/engines/fio-engine-libaio.c
index 5e394e3..daee659 100644
--- a/engines/fio-engine-libaio.c
+++ b/engines/fio-engine-libaio.c
@@ -78,9 +78,13 @@
break;
} while (1);
- assert(ret);
+ if (ret <= 0) {
+ io_u->resid = io_u->buflen;
+ io_u->error = -ret;
+ return 1;
+ }
- return (int) -ret;
+ return 0;
}
static int fio_libaio_cancel(struct thread_data *td, struct io_u *io_u)
diff --git a/fio.c b/fio.c
index 53735c6..8571e65 100644
--- a/fio.c
+++ b/fio.c
@@ -218,14 +218,14 @@
ret = td_io_queue(td, io_u);
if (ret) {
+ td_verror(td, io_u->error);
put_io_u(td, io_u);
- td_verror(td, ret);
return 1;
}
ret = td_io_getevents(td, 1, td->cur_depth, NULL);
if (ret < 0) {
- td_verror(td, -ret);
+ td_verror(td, ret);
return 1;
}
@@ -292,8 +292,8 @@
ret = td_io_queue(td, io_u);
if (ret) {
+ td_verror(td, io_u->error);
put_io_u(td, io_u);
- td_verror(td, ret);
break;
}
@@ -399,8 +399,8 @@
ret = td_io_queue(td, io_u);
if (ret) {
+ td_verror(td, io_u->error);
put_io_u(td, io_u);
- td_verror(td, ret);
break;
}