qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes()


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes()
Date: Fri, 06 Feb 2015 08:31:15 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 02/06/2015 08:27 AM, Eric Blake wrote:

>>  
>> -    /* The cluster refcount was incremented, either by 
>> qcow2_alloc_clusters()
>> -     * or explicitly by qcow2_update_cluster_refcount().  Refcount blocks 
>> must
>> -     * be flushed before the caller's L2 table updates.
>> -     */
>> +    assert(offset);
>> +    ret = update_refcount(bs, offset, size, 1, QCOW2_DISCARD_NEVER);
> 
> Case 1: This incremented the new cluster. Good
> Case 2: This incremented the old cluster. Good
> Case 3: This incremented the new cluster. Good
> Case 4: This incremented the old cluster. But the new cluster remains at
> refcount 0.  BAD.

Wait. Maybe I'm confused.  You are requesting an update_refcount()
across size bytes, and given the offset, that means that the code will
round up to cover BOTH clusters in one call.  Does update_refcount()
properly increment from  [ 1, 0 ] to [ 2, 1 ] when given a 2-cluster
size (when offset, size is rounded up to cluster boundaries)?  If so,
then there is no bug after all.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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