windowsaio: skip uncompleted requests
authorBruce Cran <BCran@fusionio.com>
Thu, 5 May 2011 14:13:37 +0000 (08:13 -0600)
committerJens Axboe <jaxboe@fusionio.com>
Thu, 5 May 2011 14:13:37 +0000 (08:13 -0600)
Windows sometimes gives us an IO request which hasn't completed yet,
which we need to ignore.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
engines/windowsaio.c

index 2d3ed837de55a3e16ca30943ffb4a85d545bc115..e389b673709df4ee8fb49ffa9fd223c18403317d 100644 (file)
@@ -277,6 +277,10 @@ static DWORD WINAPI IoCompletionRoutine(LPVOID lpParameter)
                fov = CONTAINING_RECORD(ovl, FIO_OVERLAPPED, o);
                io_u = fov->io_u;
 
                fov = CONTAINING_RECORD(ovl, FIO_OVERLAPPED, o);
                io_u = fov->io_u;
 
+        /* We sometimes get an IO request that hasn't completed yet. Ignore it. */
+        if (ovl->Internal == STATUS_PENDING)
+            continue;
+
                if (ovl->Internal == ERROR_SUCCESS) {
                        io_u->resid = io_u->xfer_buflen - ovl->InternalHigh;
                        io_u->error = 0;
                if (ovl->Internal == ERROR_SUCCESS) {
                        io_u->resid = io_u->xfer_buflen - ovl->InternalHigh;
                        io_u->error = 0;