From: Kevin Wolf <kwolf@redhat.com>
To: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: aliguori@us.ibm.com, sheepdog@lists.wpkg.org,
kvm@vger.kernel.org, qemu-devel@nongnu.org, avi@redhat.com,
hch@lst.de
Subject: [Qemu-devel] Re: [RFC PATCH v4 3/3] block: add sheepdog driver for distributed storage support
Date: Fri, 04 Jun 2010 13:04:00 +0200 [thread overview]
Message-ID: <4C08DDA0.40607@redhat.com> (raw)
In-Reply-To: <87632013w5.wl%morita.kazutaka@lab.ntt.co.jp>
Am 03.06.2010 18:23, schrieb MORITA Kazutaka:
>>> +static void sd_aio_cancel(BlockDriverAIOCB *blockacb)
>>> +{
>>> + SheepdogAIOCB *acb = (SheepdogAIOCB *)blockacb;
>>> +
>>> + acb->canceled = 1;
>>> +}
>>
>> Does this provide the right semantics? You haven't really cancelled the
>> request, but you pretend to. So you actually complete the request in the
>> background and then throw the return code away.
>>
>> I seem to remember that posix-aio-compat.c waits at this point for
>> completion of the requests, calls the callbacks and only afterwards
>> returns from aio_cancel when no more requests are in flight.
>>
>> Or if you can really cancel requests, it would be the best option, of
>> course.
>>
>
> Sheepdog cannot cancel the requests which are already sent to the
> servers. So, as you say, we pretend to cancel the requests without
> waiting for completion of them. However, are there any situation
> where pretending to cancel causes problems in practice?
I'm not sure how often it would happen in practice, but if the guest OS
thinks the old value is on disk when in fact the new one is, this could
lead to corruption. I think if it can happen, even without evidence that
it actually does, it's already relevant enough.
> To wait for completion of the requests here, we may need to create
> another thread for processing I/O like posix-aio-compat.c.
I don't think you need a thread to get the same behaviour, you just need
to call the fd handlers like in the main loop. It would probably be the
first driver doing this, though, and it's not an often used code path,
so it might be a bad idea.
Maybe it's reasonable to just complete the request with -EIO? This way
the guest couldn't make any assumption about the data written. On the
other hand, it could be unhappy about failed requests, but that's
probably better than corruption.
Kevin
next prev parent reply other threads:[~2010-06-04 11:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-28 2:44 [Qemu-devel] [RFC PATCH v4 0/3] Sheepdog: distributed storage system for QEMU MORITA Kazutaka
2010-05-28 2:44 ` [Qemu-devel] [RFC PATCH v4 1/3] close all the block drivers before the qemu process exits MORITA Kazutaka
2010-05-28 2:44 ` [Qemu-devel] [RFC PATCH v4 2/3] block: call the snapshot handlers of the protocol drivers MORITA Kazutaka
2010-05-28 2:44 ` [Qemu-devel] [RFC PATCH v4 3/3] block: add sheepdog driver for distributed storage support MORITA Kazutaka
2010-06-01 14:58 ` Chris Krumme
2010-06-03 15:31 ` [Qemu-devel] " MORITA Kazutaka
2010-06-02 13:55 ` Kevin Wolf
2010-06-03 16:23 ` MORITA Kazutaka
2010-06-04 11:04 ` Kevin Wolf [this message]
2010-06-06 17:05 ` MORITA Kazutaka
2010-06-02 10:49 ` [Qemu-devel] Re: [RFC PATCH v4 0/3] Sheepdog: distributed storage system for QEMU Kevin Wolf
2010-06-03 15:18 ` MORITA Kazutaka
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=4C08DDA0.40607@redhat.com \
--to=kwolf@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=hch@lst.de \
--cc=kvm@vger.kernel.org \
--cc=morita.kazutaka@lab.ntt.co.jp \
--cc=qemu-devel@nongnu.org \
--cc=sheepdog@lists.wpkg.org \
/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).