From: Avi Kivity <avi@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: markmc@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] qcow2/virtio corruption: Don't allocate the same cluster twice
Date: Wed, 06 May 2009 20:08:33 +0300 [thread overview]
Message-ID: <4A01C411.3060505@redhat.com> (raw)
In-Reply-To: <4A01C2D4.5070000@redhat.com>
Kevin Wolf wrote:
> Avi Kivity schrieb:
>
>> What happens if the second request completes before the first? Then,
>> when the first request completes, alloc_cluster_link_l2() will call
>> copy_clusters() and overwrite the second request.
>>
>
> Ouch, you're right. I should not only check if the image is consistent,
> but also if the data survives.
>
>
We really want qemu-io fsx.
>> Also, the second request now depends on the first to update its
>> metadata. But if the first request fail, it will not update its
>> metadata, and the second request will complete without error and also
>> without updating its metadata.
>>
>
> Hm, right. Need to think about this...
>
I suggest retaining the part where you use inflight l2metas to layout
data contiguously, but change alloc_cluster_link_l2() not to rely on
n_start and nb_available but instead recompute them on completion.
m->nb_clusters should never be zeroed for this to work.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2009-05-06 17:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-06 16:39 [Qemu-devel] [PATCH] qcow2/virtio corruption: Don't allocate the same cluster twice Kevin Wolf
2009-05-06 16:54 ` [Qemu-devel] " Avi Kivity
2009-05-06 17:03 ` Kevin Wolf
2009-05-06 17:08 ` Avi Kivity [this message]
2009-05-06 17:52 ` Kevin Wolf
2009-05-06 18:31 ` Avi Kivity
2009-05-07 7:32 ` Gleb Natapov
2009-05-07 7:54 ` Avi Kivity
2009-05-07 8:01 ` Kevin Wolf
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=4A01C411.3060505@redhat.com \
--to=avi@redhat.com \
--cc=kwolf@redhat.com \
--cc=markmc@redhat.com \
--cc=qemu-devel@nongnu.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).