From 1a958f09ff7b34e91556532cf47ad1c04974369c Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Thu, 5 May 2011 08:13:37 -0600 Subject: [PATCH] windowsaio: skip uncompleted requests Windows sometimes gives us an IO request which hasn't completed yet, which we need to ignore. Signed-off-by: Jens Axboe --- engines/windowsaio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engines/windowsaio.c b/engines/windowsaio.c index 2d3ed837..e389b673 100644 --- a/engines/windowsaio.c +++ b/engines/windowsaio.c @@ -277,6 +277,10 @@ static DWORD WINAPI IoCompletionRoutine(LPVOID lpParameter) 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; -- 2.25.1