Bug 598407 - qcow2 corruption bug in refcount table growth
Summary: qcow2 corruption bug in refcount table growth
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm   
(Show other bugs)
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2010-06-01 10:48 UTC by Kevin Wolf
Modified: 2013-01-09 22:39 UTC (History)
4 users (show)

Fixed In Version: qemu-kvm-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 598488 (view as bug list)
Last Closed: 2010-07-02 07:21:04 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Kevin Wolf 2010-06-01 10:48:30 UTC
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.

Comment 4 Qunfang Zhang 2010-06-17 10:10:28 UTC
Can reproduce the issue on qemu-kvm-, and verified pass on qemu-kvm- with the given steps.

Comment 6 Qunfang Zhang 2010-07-02 07:20:32 UTC
Close it according to Comment 4.

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