From: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Josh Durgin <josh.durgin@inktank.com>,
ceph-devel@vger.kernel.org, qemu-devel <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCHv5] rbd block driver fix race between aio completition and aio cancel
Date: Fri, 30 Nov 2012 09:57:53 +0100 [thread overview]
Message-ID: <50B87511.1010100@profihost.ag> (raw)
In-Reply-To: <CAJSP0QVoBckEU62zmyW9uDDNK-hU1iV5maDgS-s96PH-6byFLw@mail.gmail.com>
fixed in V6
Am 30.11.2012 09:26, schrieb Stefan Hajnoczi:
> On Thu, Nov 29, 2012 at 10:37 PM, Stefan Priebe <s.priebe@profihost.ag> wrote:
>> @@ -568,6 +562,10 @@ static void qemu_rbd_aio_cancel(BlockDriverAIOCB *blockacb)
>> {
>> RBDAIOCB *acb = (RBDAIOCB *) blockacb;
>> acb->cancelled = 1;
>> +
>> + while (acb->status == -EINPROGRESS) {
>> + qemu_aio_wait();
>> + }
>> }
>>
>> static const AIOCBInfo rbd_aiocb_info = {
>> @@ -639,6 +637,7 @@ static void rbd_aio_bh_cb(void *opaque)
>> acb->common.cb(acb->common.opaque, (acb->ret > 0 ? 0 : acb->ret));
>> qemu_bh_delete(acb->bh);
>> acb->bh = NULL;
>> + acb->status = 0;
>>
>> qemu_aio_release(acb);
>> }
>
> We cannot release acb in rbd_aio_bh_cb() when acb->cancelled == 1
> because qemu_rbd_aio_cancel() still accesses it. This was discussed
> in an early version of the patch.
>
> Stefan
>
prev parent reply other threads:[~2012-11-30 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-29 21:37 [Qemu-devel] [PATCHv5] rbd block driver fix race between aio completition and aio cancel Stefan Priebe
2012-11-30 8:26 ` Stefan Hajnoczi
2012-11-30 8:57 ` Stefan Priebe - Profihost AG [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50B87511.1010100@profihost.ag \
--to=s.priebe@profihost.ag \
--cc=ceph-devel@vger.kernel.org \
--cc=josh.durgin@inktank.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).