From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtFqp-0002WX-G2 for qemu-devel@nongnu.org; Tue, 25 Nov 2014 08:08:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtFqj-0000op-8b for qemu-devel@nongnu.org; Tue, 25 Nov 2014 08:08:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtFqj-0000o8-05 for qemu-devel@nongnu.org; Tue, 25 Nov 2014 08:08:09 -0500 Date: Tue, 25 Nov 2014 13:08:04 +0000 From: Stefan Hajnoczi Message-ID: <20141125130804.GE21126@stefanha-thinkpad.redhat.com> References: <1416900193-3763-1-git-send-email-ming.lei@canonical.com> <1416900193-3763-2-git-send-email-ming.lei@canonical.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dzs2zDY0zgkG72+7" Content-Disposition: inline In-Reply-To: <1416900193-3763-2-git-send-email-ming.lei@canonical.com> Subject: Re: [Qemu-devel] [PATCH v6 1/3] linux-aio: fix submit aio as a batch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org --Dzs2zDY0zgkG72+7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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) > =20 > aio_set_event_notifier(old_context, &s->e, NULL); > qemu_bh_delete(s->completion_bh); > + qemu_bh_delete(s->io_q.abort_bh); > } > =20 > void laio_attach_aio_context(void *s_, AioContext *new_context) > { > struct qemu_laio_state *s =3D s_; > =20 > + s->io_q.abort_bh =3D aio_bh_new(new_context, ioq_abort_bh, s); > s->completion_bh =3D 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 =3D=3D 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 --Dzs2zDY0zgkG72+7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUdH80AAoJEJykq7OBq3PIMAwH/RBmCN91FUmm9tac+dXuq+6L mCJfkaGfdMlWXBcSpw1Lc9ZPbtfFc2Y4c4Prl4MDYuC4UpTwVWUpSYnb8ByPAZii z9Fr0d1iHnMFA3qvf7Lx4SYjFJ8MpKr9WjEavg4YIFsBkb9hl8vARhKFx2PNCwy7 OhLv178Q7gBo7fuq8z/yWVtuSNWdqU5nWOu4rR7CgK6gFDzxflfMzUvERrYbplVY fG7Lvv7sInD0HLK5ONRNesuSfVtSxkfYMNkjW+FrUci2k2eqv/hkAalDPwt8fMkk zev53tJvNA1Lkwkxt39FJfGySd61UrztmEt+lVpiHEbJChHGkHlVKwOim1fnda4= =zw3l -----END PGP SIGNATURE----- --Dzs2zDY0zgkG72+7--