« Previous | Next » 

Revision f094a782

IDf094a78220187996e33ba5adce29789326cf6c3c

Added by aliguori over 15 years ago

Fix race in POSIX AIO emulation (Jan Kiszka)

When we cancel an AIO request that is already being processed by
aio_thread, qemu_paio_cancel should return QEMU_PAIO_NOTCANCELED as long
as aio_thread isn't done with this request. But as the latter currently
updates aiocb->ret after every block of the request, we may report
QEMU_PAIO_ALLDONE too early.

Futhermore, in case some zero-length request should have been queued,
aiocb->ret is never set to != -EINPROGRESS and callers like
raw_aio_cancel could get stuck in an endless loop.

Fix those issues by updating aiocb->ret after the request has been
fully processed. This also simplifies the locking.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6278 c046a42c-6fe2-441c-8c8c-71466251a162

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences