Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 641127 - qemu-img ignores close() errors
qemu-img ignores close() errors
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Eduardo Habkost
Virtualization Bugs
:
Depends On:
Blocks: 580954
  Show dependency treegraph
 
Reported: 2010-10-07 15:31 EDT by Eduardo Habkost
Modified: 2013-01-09 18:12 EST (History)
6 users (show)

See Also:
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'.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 07:32:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 07:20:36 EDT

  None (edit)
Description Eduardo Habkost 2010-10-07 15:31:43 EDT
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 00:21:17 EST
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 13:37:30 EDT
    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 07:32:36 EDT
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 08:49:27 EDT
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.