qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: markmc@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCH] qcow2/virtio corruption: Don't allocate the same cluster twice
Date: Wed, 06 May 2009 21:31:37 +0300	[thread overview]
Message-ID: <4A01D789.3000007@redhat.com> (raw)
In-Reply-To: <4A01CE6C.3000901@redhat.com>

Kevin Wolf wrote:
>> 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.
>>     
>
> Is there even a reason why we need to copy the unmodified sectors in
> alloc_cluster_link_l2() and cannot do that in alloc_cluster_offset()
> before we write the new data? Then the callback wouldn't need to mess
> around with figuring out which part must be overwritten and which one
> mustn't.
>   

Then you have the inverse problem, you need to only copy sectors which 
aren't under an inflight write, and if such an inflight write fails, you 
do need to copy them.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

  reply	other threads:[~2009-05-06 18:32 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
2009-05-06 17:52       ` Kevin Wolf
2009-05-06 18:31         ` Avi Kivity [this message]
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=4A01D789.3000007@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).