Skip to content

Commit

Permalink
linux-aio: Handle io_submit() failure gracefully
Browse files Browse the repository at this point in the history
It is generally not expected that io_submit() fails other than with
-EAGAIN, but corner cases like SELinux refusing I/O when permissions are
revoked are still possible. In this case, we shouldn't abort, but just
return an I/O error for the request.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1470741619-23231-1-git-send-email-kwolf@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
kevmw authored and stefanhaRH committed Aug 11, 2016
1 parent d08306d commit 44713c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion block/linux-aio.c
Expand Up @@ -221,7 +221,13 @@ static void ioq_submit(LinuxAioState *s)
break;
}
if (ret < 0) {
abort();
/* Fail the first request, retry the rest */
aiocb = QSIMPLEQ_FIRST(&s->io_q.pending);
QSIMPLEQ_REMOVE_HEAD(&s->io_q.pending, next);
s->io_q.in_queue--;
aiocb->ret = ret;
qemu_laio_process_completion(aiocb);
continue;
}

s->io_q.in_flight += ret;
Expand Down

0 comments on commit 44713c9

Please sign in to comment.