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

Reply via email to