Red Hat Bugzilla – Bug 688147
qcow2: Reads fail with backing file smaller than snapshot
Last modified: 2013-01-09 18:39:56 EST
For a QCOW2 image that is larger than its base image, when handling a read request straddling over the end of the base image, the QCOW2 driver attempts to read beyond the end of the base image and the request would fail.
Can reproduce this issue with qemu-kvm-0.12.1.2-2.149.el6.x86_64. step 1. create a base.qcow2 with 64 MB and a sn1.qcow2 with 128 MB and base.qcow2 as its backing file #qemu-img create -f qcow2 base.qcow2 64M #qemu-img create -f qcow2 -b base.qcow2 sn1.qcow2 128M 2.read data in sn1.qcow2 #qemu-io -c 'read -v 63M 2M' sn1.qcow2 Results: Found lots of "0xab instead of 0x00" 040ffe20: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffe30: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffe40: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffe50: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffe60: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffe70: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffe80: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffe90: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffea0: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffeb0: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffec0: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffed0: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffee0: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040ffef0: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040fff00: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................ 040fff10: ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................
according to comment2,set qa_ack
Verified using steps as same as comment2 with qemu-kvm-0.12.1.2-2.153.el6.x86_64 After step2 results: all "0x00" even read big than backing file ....................................... 040fff50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fff60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fff70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fff90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fffa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fffb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fffc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fffd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040fffe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 040ffff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ read 2097152/2097152 bytes at offset 66060288 2 MiB, 1 ops; 0.0000 sec (10.851 GiB/sec and 5555.5556 ops/sec)
According to comment7,set this issue status as verified.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: For a QCOW2 image that is larger than its base image, when handling a read request straddling over the end of the base image, the QCOW2 driver attempts to read beyond the end of the base image. Consequence: I/O requests that should have succeeded failed. Fix: qcow2 code changed to properly handle read base image beyond its size. Result: when using a QCOW2 image that is larger than its base image, when handling a read request straddling over the end of the base image, I/O will succeed.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0534.html