On 2017-10-24 10:56, Anton Nefedov wrote:
> during discard, signed integer overflow leads to end_offset possibly
> be less than offset,
> that in turn makes nb_clusters (to discard) much bigger than expected,
> leading to a possible data loss, operation taking very long and
> image growing large as discard will allocate L2 tables for all that
> huge amount of clusters
> 
> One possibility where nb_sectors is large enough (>=2^21) is vm_state
> discard at snapshot creation.
> 
> Fixed on master in 2.10 with:
> 
>     d2cb36af2b0040d421b347e6e4e803e07220f78d
>     Author: Eric Blake <ebl...@redhat.com>
>     Date:   Sat May 6 19:05:52 2017 -0500
> 
>     qcow2: Discard/zero clusters by byte count
> 
> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com>
> Signed-off-by: Denis V. Lunev <d...@openvz.org>
> ---
>  block/qcow2.h         | 6 +++---
>  block/qcow2-cluster.c | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)

FWIW:
Reviewed-by: Max Reitz <mre...@redhat.com>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to