]> git.ipfire.org Git - thirdparty/qemu.git/commit
vmdk: Fix next_cluster_sector for compressed write
authorFam Zheng <famz@redhat.com>
Wed, 6 May 2015 12:23:46 +0000 (20:23 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 28 Jul 2015 23:18:27 +0000 (18:18 -0500)
commit53cd79c1173457b765c016a1ec95ef87188a9893
treedb46abab8521c02b7008ca4e6b76209431ef148c
parent3dd15f3e582c76d349eb6817b0775615c545d44f
vmdk: Fix next_cluster_sector for compressed write

This fixes the bug introduced by commit c6ac36e (vmdk: Optimize cluster
allocation).

Sometimes, write_len could be larger than cluster size, because it
contains both data and marker.  We must advance next_cluster_sector in
this case, otherwise the image gets corrupted.

Cc: qemu-stable@nongnu.org
Reported-by: Antoni Villalonga <qemu-list@friki.cat>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 5e82a31eb967db135fc4e688b134fb0972d62de3)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/vmdk.c