qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH][RESEND] qcow2: Fix cluster allocation


From: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH][RESEND] qcow2: Fix cluster allocation
Date: Wed, 07 Jan 2009 11:22:25 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Kevin Wolf wrote:
When allocating multiple clusters at once, the qcow2 implementation
tries to find as many physically contiguous clusters as possible to
allow larger writes. This search includes allocated clusters which are
in the right place and still free clusters. If the range to allocate
spans clusters in patterns like "10 allocated, then 10 free, then again
10 allocated" it is only checked that the chunks of allocated clusters
are contiguous for themselves.

However, what is actually needed is to have _all_ allocated clusters
contiguous, starting at the first cluster of the allocation and spanning
multiple such chunks. This patch changes the check so that each offset
is not compared to the offset of the first cluster in its own chunk but
to the first cluster in the whole allocation.

I haven't seen it happen, but without this fix data corruption on qcow2
images is possible.

Signed-off-by: Kevin Wolf <address@hidden>
Acked-by: Gleb Natapov <address@hidden>
Applied.  Thanks.

Regards,

Anthony Liguori




reply via email to

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