Hide Forgot
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.
Fix included in qemu-kvm-rhev-2.3.0-18.el7
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
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
According to comment2 and comment3, set this issue as verified.
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