Rate must always calculate bytes done
[fio.git] / engines / posixaio.c
index ef4d78ebe8a58c03465eb33cdc58aa7f90b52d7c..ebd6faf86b14b30e2dd4eabf8b5f9726d1d8d6aa 100644 (file)
@@ -67,8 +67,8 @@ static int fio_posixaio_prep(struct thread_data fio_unused *td,
        struct fio_file *f = io_u->file;
 
        aiocb->aio_fildes = f->fd;
-       aiocb->aio_buf = io_u->buf;
-       aiocb->aio_nbytes = io_u->buflen;
+       aiocb->aio_buf = io_u->xfer_buf;
+       aiocb->aio_nbytes = io_u->xfer_buflen;
        aiocb->aio_offset = io_u->offset;
 
        io_u->seen = 0;
@@ -151,10 +151,13 @@ static int fio_posixaio_queue(struct thread_data fio_unused *td,
        else
                ret = aio_fsync(O_SYNC, aiocb);
 
-       if (ret)
+       if (ret) {
                io_u->error = errno;
-               
-       return io_u->error;
+               td_verror(td, io_u->error, "xfer");
+               return FIO_Q_COMPLETED;
+       }
+
+       return FIO_Q_QUEUED;
 }
 
 static void fio_posixaio_cleanup(struct thread_data *td)