Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 1448350[details]
Compressed corrupted qcow2 image
Description of problem:
qemu’s qcow2 driver does not consider whether an image is inactive when marking it corrupt. This results in an assertion failure because inactive images may not be written to.
Version-Release number of selected component (if applicable):
Upstream (2.12.50), and in RHV (qemu-kvm-rhev-2.12.0-3.el7).
(RHEL (1.5.3) is not directly affected because there is no assertion preventing writes to inactive disks. We should not try to write to it anyway, but at least it does not cause a VM crash.)
How reproducible:
Always.
Steps to Reproduce:
1. Download the attached qcow2 file and place it in your working directory.
2. Execute the following:
$ echo -e 'qemu-io none0 "read 0 64k"\nquit' \
| qemu-system-x86_64 -drive if=none,file=corrupted.qcow2 \
-monitor stdio \
-incoming exec:'cat /dev/null'
Actual results:
QEMU 2.12.0 monitor - type 'help' for more information
(qemu) qemu-io none0 "read 0 64k"
qcow2: Marking image as corrupt: L2 table offset 0x44200 unaligned (L1 index: 0); further corruption events will be suppressed
qemu-system-x86_64: block/io.c:1682: bdrv_co_pwritev: Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed.
[1] 16427 done echo 'qemu-io none0 "read 0 64k"' |
16428 abort (core dumped) qemu-system-x86_64 -drive if=none,file=corrupted.qcow2 -monito
Expected results:
QEMU 2.12.0 monitor - type 'help' for more information
(qemu) qemu-io none0 "read 0 64k"
qcow2: Image is corrupt: L2 table offset 0x44200 unaligned (L1 index: 0); further non-fatal corruption events will be suppressed
read failed: Input/output error
(qemu) quit
(The qcow2 driver does not try to mark the image corrupt (as if it were read-only), and thus, no crash occurs.)
Additional info:
Noticed in the logs for BZ 1583346.
Comment 3Miroslav Rezanina
2018-06-25 14:19:30 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://access.redhat.com/errata/RHBA-2018:3443