The same bug exists in RHEL 5.5/5.6. +++ This bug was initially created as a clone of Bug #598407 +++ A bug in rarely used code path in the refcount table growth code of qcow2 can lead to inconsistencies in the metadata, which can cause real data corruption later on. This bug can be reproduced like this: [rhel6/master] kwolf@dhcp-5-188:~/source/qemu-kvm-rhel6$ ./qemu-img create -f qcow2 -ocluster_size=512 /tmp/test.qcow2 1G Formatting '/tmp/test.qcow2', fmt=qcow2 size=1073741824 encryption=off cluster_size=512 [rhel6/master] kwolf@dhcp-5-188:~/source/qemu-kvm-rhel6$ ./qemu-io /tmp/test.qcow2 qemu-io> write -b 0 64M wrote 67108864/67108864 bytes at offset 0 64 MiB, 1 ops; 0:00:11.00 (5.791 MiB/sec and 0.0905 ops/sec) qemu-io> [rhel6/master] kwolf@dhcp-5-188:~/source/qemu-kvm-rhel6$ ./qemu-img check /tmp/test.qcow2 ERROR cluster 768 refcount=0 reference=1 ERROR cluster 773 refcount=2 reference=1 ERROR cluster 774 refcount=2 reference=1 ERROR cluster 1024 refcount=0 reference=1 ERROR cluster 1029 refcount=2 reference=1 ERROR cluster 1030 refcount=2 reference=1 ERROR cluster 1031 refcount=2 reference=1 7 errors were found on the image.
Reproduced on kvm-83-181.el5, and verified pass on kvm-83-182.el5 Steps: 1.Create a disk on *RHEL6* host #qemu-img create -f qcow2 -ocluster_size=512 test.qcow2 1G 2.Copy this disk to RHEL5 host #/usr/libexec/qemu-kvm test.qcow2 -monitor stdio -vnc :10 (qemu)savevm aaa (qemu)savevm bbb (qemu)info snapshots (qemu)quit 3.#qemu-img check test.qcow2 On kvm-83-181.el5: [root@dhcp-91-161 home]# qemu-img check test.qcow2 ERROR cluster 768 refcount=0 reference=1 ERROR cluster 773 refcount=2 reference=1 ERROR cluster 774 refcount=2 reference=1 ERROR cluster 1024 refcount=0 reference=1 ERROR cluster 1029 refcount=2 reference=1 ERROR cluster 1030 refcount=2 reference=1 ERROR cluster 1031 refcount=2 reference=1 ERROR cluster 2304 refcount=0 reference=1 ERROR cluster 2371 refcount=2 reference=1 ERROR cluster 2372 refcount=2 reference=1 ERROR cluster 2560 refcount=0 reference=1 ERROR cluster 2627 refcount=2 reference=1 ERROR cluster 2628 refcount=2 reference=1 ERROR cluster 2629 refcount=2 reference=1 ERROR cluster 4352 refcount=0 reference=1 ERROR cluster 4428 refcount=2 reference=1 ERROR cluster 4429 refcount=2 reference=1 ERROR cluster 4608 refcount=0 reference=1 ERROR cluster 4684 refcount=2 reference=1 ERROR cluster 4685 refcount=2 reference=1 ERROR cluster 4686 refcount=2 reference=1 21 errors were found on the image. On kvm-83-182.el5 [root@dhcp-91-161 home]# qemu-img check test.qcow2 No errors were found on the image.
Re-verify this bug with package kvm-83-207.el5 as comment 5 steps, after step3, then check image, no error shows. Change bug to verified.
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-0028.html