|
From: | Anton Nefedov |
Subject: | Re: [Qemu-devel] [PATCH v1 03/13] qcow2: do not COW the empty areas |
Date: | Tue, 23 May 2017 11:31:51 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 05/22/2017 10:24 PM, Eric Blake wrote:
On 05/19/2017 04:34 AM, Anton Nefedov wrote:If COW area of the newly allocated cluster is zeroes, there is no reason to write zero sectors in perform_cow() again now as whole clusters are zeroed out in single chunks by handle_alloc_space().But that's only true if you can guarantee that handle_alloc_space() succeeded at ensuring the cluster reads as zeroes. If you silently ignore errors (which is what patch 1/13 does), you risk assuming that the cluster reads as zeroes when in reality it does not, and then you have corrupted data.
Sure; COW is only skipped if pwrite_zeroes() from patch 1/13 succeeds
The idea of avoiding a COW of areas that read as zero at the source when the destination also already reads as zeroes makes sense, but I'm not convinced that this patch is safe as written.
/Anton
[Prev in Thread] | Current Thread | [Next in Thread] |