vmdk: Fix big flat extent IO
PATCH 1/1 vmdk: Fix big flat extent IO
Local variable "n" as int64_t avoids overflow with large sector number calculation. See test case change for failure case.
Signed-off-by Fam Zheng <[email protected]>
--- block/vmdk.c | 4 +-- tests/qemu-iotests/059 | 7 +++++ tests/qemu-iotests/059.out | 74 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-)
block/vmdk.c +2 -2
@@ -1320,8 +1320,8 @@ static int vmdk_write(BlockDriverState *bs, int64_t sector_num, {BDRVVmdkState *s = bs->opaque;VmdkExtent *extent =NULL ; -int n, ret; -int64_t index_in_cluster; +int ret; +int64_t index_in_cluster, n;uint64_t extent_begin_sector, extent_relative_sector_num;uint64_t cluster_offset;VmdkMetaData m_data;
tests/qemu-iotests/059 +7 -0
@@ -85,6 +85,13 @@ echo "=== Testing version 3 ===" _use_sample_img iotest-version3.vmdk.bz2 _img_info +echo +echo "=== Testing 4TB monolithicFlat creation and IO ===" +IMGOPTS="subformat=monolithicFlat" _make_test_img 4T +_img_info +$QEMU_IO -c "write -P 0xa 900G 512" "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "read -v 900G 1024" "$TEST_IMG" | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full
tests/qemu-iotests/059.out +74 -0
78 lines not on this page · raw message
Signature · 1 line
1.8.5.1
Kevin Wolf
AppliedAm 08.01.2014 um 02:42 hat Fam Zheng geschrieben:
Quoted 4 lines
Local variable "n" as
int64_tavoids overflow with large sector number calculation. See test case change for failure case.Signed-off-by Fam Zheng <[email protected]>
Thanks, applied to the block branch.
Kevin