On 12/10/2010 02:38 PM, Christoph Hellwig wrote:
if it's smaller than the block size we'll zero out the remainder of
the block.
I think it should fail at VM startup time, or even better do nothing at all.
When you write in the middle of an absent block, and a partially-zero
block is created, this is not visible: a read cannot see the difference
between "all zeros because it's sparse" and "all zeros because it's zero".
If I ask you to (optionally) punch a 1kb hole but all you can do is
punch a 2kb hole, I do care about the second kilobyte of data. Since
the hole punching of bdrv_discard is completely optional, it should not
be done in this case.
Paolo