Bug 1134241

Summary: QEMU fails to correctly read/write on VMDK with big flat extent
Product: Red Hat Enterprise Linux 7 Reporter: Fam Zheng <famz>
Component: qemu-kvmAssignee: Fam Zheng <famz>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: hhuang, huding, juzhang, mrezanin, rbalakri, sluo, tlavigne, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-84.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 08:11:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fam Zheng 2014-08-27 07:43:11 UTC
The variable used in VMDK driver is "int" type, which will easily overflow if the extent size is large.

Quoting the test case from upstream qemu-iotests:

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

Which creates a 4TB monolithicFlat VMDK, and write at the offset of 900G. The write will hang, fail or at best succeed but pattern 0xa is not written to 900G offset in the image.

Expected result:

The pattern 0xa is written to correct position in image (900G).

Comment 4 Jeff Nelson 2014-12-16 23:40:38 UTC
Fix included in qemu-kvm-1.5.3-84.el7

Comment 6 Sibiao Luo 2014-12-24 09:24:13 UTC
Chart with famz in irc that we can run case 059 in qemu-iotests to verify this issue directly.

host info:
# uname -r && rpm -q qemu-kvm
3.10.0-219.el7.x86_64
qemu-kvm-1.5.3-84.el7.x86_64

qemu-iotests]# git branch -v
* rhel7/master-1.5.3 372a88f Update to qemu-kvm-1.5.3-84.el7
qemu-iotests]# ./check -vmdk
QEMU          -- /usr/libexec/qemu-kvm
QEMU_IMG      -- /usr/bin/qemu-img
QEMU_IO       -- /usr/bin/qemu-io 
IMGFMT        -- vmdk
IMGPROTO      -- file
PLATFORM      -- Linux/x86_64 dhcp-10-88 3.10.0-219.el7.x86_64
001        
002        
003        
...
053         [not run] not suitable for this image format: vmdk
054         [not run] not suitable for this image format: vmdk
059        
060         [not run] not suitable for this image format: vmdk
...
092         [not run] not suitable for this image format: vmdk
105        
Not run: 006 007 013 014 015 016 022 023 024 025 026 028 029 030 031 035 036 038 039 040 041 042 043 044 045 046 047 048 049 050 051 053 054 060 061 062 064 065 066 067 068 070 075 076 077 078 079 080 082 084 086 087 088 092
Passed all 25 tests

Base on above, this issue has been fixed correctly, move to VERIFIED status. Please correct me if any mistake, thanks.

Best Regards,
sluo

Comment 8 errata-xmlrpc 2015-03-05 08:11:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0349.html