qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 14/20] qcow2: Factor out count_cow_clusters


From: Marcelo Tosatti
Subject: Re: [Qemu-devel] [PATCH 14/20] qcow2: Factor out count_cow_clusters
Date: Thu, 19 Apr 2012 18:18:46 -0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Apr 19, 2012 at 05:14:20PM -0300, Marcelo Tosatti wrote:
> > There is one intended change in functionality in this patch, which is
> > that it allocates new clusters even when it could satisfy the first part
> > of the request with already allocated clusters. In order to check if
> > there is a problem with this scenario, the following patch should revert
> > to the old behaviour:
> > 
> > --- a/block/qcow2-cluster.c
> > +++ b/block/qcow2-cluster.c
> > @@ -847,7 +847,7 @@ again:
> >          keep_clusters = count_contiguous_clusters(nb_clusters,
> > s->cluster_size,
> >                                                    &l2_table[l2_index],
> > 0, 0);
> >          assert(keep_clusters <= nb_clusters);
> > -        nb_clusters -= keep_clusters;
> > +        nb_clusters = 0;
> >      } else {
> >          /* For the moment, overwrite compressed clusters one by one */
> >          if (cluster_offset & QCOW_OFLAG_COMPRESSED) {
> > 
> > The rest is meant to be a functionally equivalent rewrite of the old
> > code that was required in order to allow this change.
> 
> Testing.

Corruption gone with patch above.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]