Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 688147 - qcow2: Reads fail with backing file smaller than snapshot
qcow2: Reads fail with backing file smaller than snapshot
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Kevin Wolf
Virtualization Bugs
:
Depends On:
Blocks: 698924
  Show dependency treegraph
 
Reported: 2011-03-16 09:22 EDT by Kevin Wolf
Modified: 2013-01-09 18:39 EST (History)
5 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.151.el6
Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of:
: 698924 (view as bug list)
Environment:
Last Closed: 2011-05-19 07:21:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 07:20:36 EDT

  None (edit)
Description Kevin Wolf 2011-03-16 09:22:27 EDT
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.
Comment 2 juzhang 2011-03-17 08:06:29 EDT
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  ................
Comment 3 juzhang 2011-03-17 08:07:16 EDT
according to comment2,set qa_ack
Comment 7 juzhang 2011-03-30 02:29:40 EDT
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)
Comment 8 juzhang 2011-03-30 02:31:12 EDT
According to comment7,set this issue status as verified.
Comment 9 Eduardo Habkost 2011-05-03 15:17:26 EDT
    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.
Comment 10 errata-xmlrpc 2011-05-19 07:21:21 EDT
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
Comment 11 errata-xmlrpc 2011-05-19 09:02:23 EDT
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

Note You need to log in before you can comment on or make changes to this bug.