vmdk: Fix zero cluster allocation
commit2821c1cc0f8cbfcc332387e83be746af6f27cb4f
authorKevin Wolf <kwolf@redhat.com>
Thu, 30 Apr 2020 13:30:03 +0000 (30 15:30 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 8 May 2020 11:26:35 +0000 (8 13:26 +0200)
tree8718cb3217caee3ec65fae3fc6ee98300aede534
parent4dc20e6465eccd2466a449d3fb49539f5d9f53dd
vmdk: Fix zero cluster allocation

m_data must contain valid data even for zero clusters when no cluster
was allocated in the image file. Without this, zero writes segfault with
images that have zeroed_grain=on.

For zero writes, we don't want to allocate a cluster in the image file
even in compressed files.

Fixes: 524089bce43fd1cd3daaca979872451efa2cf7c6
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200430133007.170335-3-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/vmdk.c