On Tue, Nov 25, 2014 at 03:23:11PM +0800, Ming Lei wrote:
> @@ -296,12 +370,14 @@ void laio_detach_aio_context(void *s_, AioContext 
> *old_context)
>  
>      aio_set_event_notifier(old_context, &s->e, NULL);
>      qemu_bh_delete(s->completion_bh);
> +    qemu_bh_delete(s->io_q.abort_bh);
>  }
>  
>  void laio_attach_aio_context(void *s_, AioContext *new_context)
>  {
>      struct qemu_laio_state *s = s_;
>  
> +    s->io_q.abort_bh = aio_bh_new(new_context, ioq_abort_bh, s);
>      s->completion_bh = aio_bh_new(new_context, qemu_laio_completion_bh, s);
>      aio_set_event_notifier(new_context, &s->e, qemu_laio_completion_cb);
>  }

These functions are incomplete when ->aborting == true.  I can't think
of a reason why we are guaranteed never to hit that state, and fixing it
is easy.  Just add the following to the end of
laio_attach_aio_context():

if (s->aborting) {
    qemu_bh_schedule(s->io_q.abort_bh);
}

Stefan

Attachment: pgp6ZGFRaYquX.pgp
Description: PGP signature

Reply via email to