On Mon, Jul 14, 2014 at 12:49:38PM +0200, Paolo Bonzini wrote:
> Il 14/07/2014 10:36, Paolo Bonzini ha scritto:
> >
> >
> >to
> >
> >            /* In case elem->common.cb() makes a nested aio_poll() call,
> >             * next may become invalid as well.  Instead of just
> >             * restarting the QLIST_FOREACH_SAFE, go through the BH
> >             * once more, which also avoids deadlock if element A's
> >             * callback waits for element B and both completed at the
> >             * same time.
> >             */
> >            qemu_bh_schedule(pool->completion_bh);
> >            elem->common.cb(elem->common.opaque, elem->ret);
> >            qemu_aio_release(elem);
> 
> This is of course missing here:
> 
>               break;

Let's keep goto restart so we don't use the BH for each completion
callback.  We just need the BH scheduled once to protect against the
deadlock.

Stefan

Attachment: pgpdMo0hHapXc.pgp
Description: PGP signature

Reply via email to