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.

Bug 974617

Summary: qcow2 corruption bug in cluster allocation code
Product: Red Hat Enterprise Linux 6 Reporter: Kevin Wolf <kwolf>
Component: qemu-kvmAssignee: Kevin Wolf <kwolf>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.5CC: acathrow, areis, bsarathy, chayang, juzhang, kwolf, lnovich, lyarwood, michen, mkenneth, pm-rhel, qzhang, sluo, svenkatr, virt-maint
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.376.el6 Doc Type: Bug Fix
Doc Text:
* Previously, a counter variable was not correctly reset when restarting an allocating request for disk images using the qcow2 format, which resulted in corruption of these disk images in the cluster allocation code in some cases. This update changes the way that the number of available clusters are counted in the qcow2 format, and qcow2 disks are no longer corrupted in the described scenario.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 06:59:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 996151    
Attachments:
Description Flags
Result - GOOD
none
Result - BAD none

Description Kevin Wolf 2013-06-14 15:44:23 UTC
A counter variable isn't correctly reset when restarting an allocating request
in qcow2, resulting in corruption in some cases. For details, see
https://bugs.launchpad.net/ubuntu/quantal/+source/qemu-kvm/+bug/1189926 that
was opened against an Ubuntu release using the same code:

> [Impact]
>
> When using qemu-kvm-1.0 occasionally qcow2 disks will be corrupted.
>
> [Test Case]
>
> A test case can be downloaded here:
>     http://people.canonical.com/~arges/lp1189926/lnv-382.tgz
>     Extract the contents and run ./create-disk, then ./test-kvm to test the
>     currently installed KVM. Keep in mind that 100GB+ of disk is required to
>     run the test.
>
> [...]

This bug was introduced in RHEL 6 commit 73ea798d. The first release to contain
this commit is 6.3.

Comment 2 Qunfang Zhang 2013-06-16 08:11:39 UTC
Test this bug according to comment 0,on the following version[1] for twice, first time the result shows GOOD and the second time, the result shows BAD. Attachment will be uploaded.

[1]
qemu-kvm-0.12.1.2-2.375.el6.x86_64
kernel-2.6.32-384.el6.x86_64

Hi, Kevin
Could you help confirm my second log (BAD result), does this mean I reproduce the issue? 

Thanks,
Qunfang

Comment 3 Qunfang Zhang 2013-06-16 08:13:25 UTC
Created attachment 761775 [details]
Result - GOOD

Comment 4 Qunfang Zhang 2013-06-16 08:14:40 UTC
Created attachment 761776 [details]
Result - BAD

Comment 6 Kevin Wolf 2013-06-17 16:56:49 UTC
(In reply to Qunfang Zhang from comment #2)
> Hi, Kevin
> Could you help confirm my second log (BAD result), does this mean I
> reproduce the issue?

It's not my test case, so I have to guess the same as you have. But it looks to
me as if you reproduced the issue indeed. It also says:

*** localhost[0] Sun Jun 16 08:05:01 201 Error: Data corruption

Comment 10 Qunfang Zhang 2013-06-25 04:49:14 UTC
Reproduced again on qemu-kvm-rhev-0.12.1.2-2.375.el6.x86_64 on the first attempt. And then verified it for 3 times on qemu-kvm-rhev-0.12.1.2-2.376.el6.x86_64, all the test pass. 

Steps:
0. Make sure host has 100GB+ free disk. 
1. Download 
http://people.canonical.com/~arges/lp1189926/lnv-382.tgz
2. Uncompress the lnv-382.tgz
3. ./create-disk
4. Modified "test-kvm" and replace command "kvm" to "/usr/libexec/qemu-kvm".
5. ./test-kvm

Result: On the fixed version qemu-kvm-rhev-0.12.1.2-2.376.el6.x86_64, the test passed. I tried 3 times and all passed. 

RESULT: GOOD
Return value: 0

Comment 17 errata-xmlrpc 2013-11-21 06:59:29 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.

http://rhn.redhat.com/errata/RHSA-2013-1553.html

Comment 18 Ademar Reis 2014-04-04 12:59:53 UTC
*** Bug 993611 has been marked as a duplicate of this bug. ***