Bug 1226297 - qcow2 crash during discard operation
Summary: qcow2 crash during discard operation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-29 11:51 UTC by Kevin Wolf
Modified: 2015-12-04 16:43 UTC (History)
5 users (show)

Fixed In Version: qemu-kvm-rhev-2.3.0-18.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-04 16:43:08 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2546 normal SHIPPED_LIVE qemu-kvm-rhev bug fix and enhancement update 2015-12-04 21:11:56 UTC

Description Kevin Wolf 2015-05-29 11:51:59 UTC
First reported in https://bugs.launchpad.net/qemu/+bug/1349972

Steps to reproduce:
1. Get the attached tarball from the Launchpad bug
2. Unpack test.img and backing_img.qed in the same directory (see the attached archives for images)
3. Make a copy of test.img to copy.img (qemu-io modifies the image before being kill, therefore the image backup is necessary)
4. qemu-io copy.img -c 'discard 2210816 2856448'

qemu-io: block/qcow2-refcount.c:468: update_refcount_discard: Assertion `d->bytes + length == new_end - new_start' failed.

Fixed upstream in commit ecbda7a2.

Comment 1 Miroslav Rezanina 2015-08-14 16:22:06 UTC
Fix included in qemu-kvm-rhev-2.3.0-18.el7

Comment 2 huiqingding 2015-08-18 03:19:14 UTC
Reproduce this bug using the following version:
qemu-kvm-rhev-2.3.0-16.el7.x86_64
qemu-img-rhev-2.3.0-16.el7.x86_64
kernel-3.10.0-304.el7.x86_64

Steps to Reproduce:
1. Get the tarball images.n.traces.tar.gz from the link of comment #0
2. unpack the tarball
# tar xzvf images.n.traces.tar.gz
3. copy test.img to copy.img
# cp test.img copy.img
4. run discard operation
# qemu-io copy.img -c 'discard 2210816 2856448'

Actual results:
after step4, output the info:
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Invalid argument
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Invalid argument
... ...
qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with refcount block); further corruption events will be suppressed
qemu-io: block/qcow2-refcount.c:645: update_refcount_discard: Assertion `d->bytes + length == new_end - new_start' failed.
Aborted

Comment 3 huiqingding 2015-08-18 03:22:47 UTC
Test this bug using the following version:
qemu-kvm-rhev-2.3.0-18.el7.x86_64
qemu-img-rhev-2.3.0-18.el7.x86_64
kernel-3.10.0-304.el7.x86_64

The test steps are same as comment #2

Test results:
after step4, output the info:
# qemu-io copy.img -c 'discard 2210816 2856448'
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Invalid argument
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Resource temporarily unavailable
qcow2_free_clusters failed: Invalid argument
... ...
qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with refcount block); further corruption events will be suppressed
discard failed: Input/output error

Comment 5 juzhang 2015-08-24 02:36:35 UTC
According to comment2 and comment3, set this issue as verified.

Comment 7 errata-xmlrpc 2015-12-04 16:43:08 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/RHBA-2015-2546.html


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