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 641127 - qemu-img ignores close() errors
Summary: qemu-img ignores close() errors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Eduardo Habkost
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 580954
TreeView+ depends on / blocked
 
Reported: 2010-10-07 19:31 UTC by Eduardo Habkost
Modified: 2013-01-09 23:12 UTC (History)
6 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.116.el6
Doc Type: Bug Fix
Doc Text:
Cause: qemu-img ignored close() errors when running 'qemu-img create' Consequence: on some scenarios (e.g. when using a NF filesystem), errors where ignored when creating an image using 'qemu-img create'. Fix: qemu-img create now checks for close() errors. Result: more reliable error handling of 'qemu-img create'.
Clone Of:
Environment:
Last Closed: 2011-05-19 11:32:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 0 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 11:20:36 UTC

Description Eduardo Habkost 2010-10-07 19:31:43 UTC
Description of problem:

On a machine having NFS trouble, 'qemu-img create' tries to create a new qcow2 image and when close() returns -EIO, but the error is silently ignored.


Version-Release number of selected component (if applicable):
qemu-img-0.12.1.2-2.113.el6.x86_64

How reproducible:
Not easily, as you have to make close() return error (I have a machine where this is happening for unknown reasons).


Steps to Reproduce:
1) break NFS  :)
2) run: qemu-img create -f qcow2 /path/to/file/on/nfs.qcow2 10G

  
Actual results:
# strace -f qemu-img create -f qcow2 /tmp/kvm_autotest_root/images/rhel5-32.qcow2 10G
execve("/usr/bin/qemu-img", ["qemu-img", "create", "-f", "qcow2", "/tmp/kvm_autotest_root/images/rh"..., "10G"], [/* 29 vars */]) = 0
brk(0)                                  = 0x2226000
[...]
write(1, "Formatting '/tmp/kvm_autotest_ro"..., 117Formatting '/tmp/kvm_autotest_root/images/rhel5-32.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=0
) = 117
open("/tmp/kvm_autotest_root/images/rhel5-32.qcow2", O_WRONLY|O_CREAT|O_TRUNC, 0644) = 3
write(3, "QFI\373\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\0\0\2\200\0\0\0"..., 72) = 72
lseek(3, 65536, SEEK_SET)               = 65536
write(3, "\0\0\0\0\0\0\0\0", 8)         = 8
[...]
close(3)                                = -1 EIO (Input/output error)
exit_group(0)                           = ?
[root@virtlab105 default]# date
Thu Oct  7 15:30:46 EDT 2010
[root@virtlab105 default]# ls -l /tmp/kvm_autotest_root/images/rhel5-32.qcow2
-rw-r--r-- 1 root root 262144 Oct  7 15:27 /tmp/kvm_autotest_root/images/rhel5-32.qcow2
[root@virtlab105 default]# date
Thu Oct  7 15:30:52 EDT 2010
[root@virtlab105 default]# ls -l /tmp/kvm_autotest_root/images/rhel5-32.qcow2
-rw-r--r-- 1 root root 0 Oct  7 15:27 /tmp/kvm_autotest_root/images/rhel5-32.qcow2
[root@virtlab105 default]# 


Expected results:
qemu-img should return non-zero exit code and show an error message.

Comment 5 Shirley Zhou 2011-01-13 05:21:17 UTC
Cannot reproduce this bug with qemu-kvm-0.12.1.2-2.129.el6, and confirm the patch: 

# grep "check for close() errors on qcow2_create()" *
kvm-check-for-close-errors-on-qcow2_create.patch:Subject: [RHEL6 qemu-kvm PATCH 3/3] check for close() errors on qcow2_create()
kvm-check-for-close-errors-on-qcow2_create.patch:O-Subject: [RHEL6 qemu-kvm PATCH] check for close() errors on qcow2_create()

# grep "kvm-check-for-close-errors-on-qcow2_create.patch" ../SPECS/*
Patch1714: kvm-check-for-close-errors-on-qcow2_create.patch
- kvm-check-for-close-errors-on-qcow2_create.patch [bz#641127]

# grep  -i Patch1714 ../SPECS/*
Patch1714: kvm-check-for-close-errors-on-qcow2_create.patch
%patch1714 -p1

So this bug has been resolved.

Comment 7 Eduardo Habkost 2011-05-05 17:37:30 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: qemu-img ignored close() errors when running 'qemu-img create'

Consequence: on some scenarios (e.g. when using a NF filesystem), errors where ignored when creating an image using 'qemu-img create'.

Fix: qemu-img create now checks for close() errors.

Result: more reliable error handling of 'qemu-img create'.

Comment 8 errata-xmlrpc 2011-05-19 11:32:36 UTC
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-0534.html

Comment 9 errata-xmlrpc 2011-05-19 12:49:27 UTC
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-0534.html


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