Hide Forgot
Description of problem: bdrv_make_zero() clamps the nb_sectors value: if (nb_sectors > INT_MAX) { nb_sectors = INT_MAX; } But INT_MAX is too large because bdrv_rw_co() performs the following check later: if (nb_sectors < 0 || nb_sectors > INT_MAX / BDRV_SECTOR_SIZE) { return -EINVAL; } Fam Zheng already fixed this bug upstream so we just need to backport the fix: http://git.qemu-project.org/?p=qemu.git;a=commitdiff;h=f3a9cfddaec127078ac1898de6b063db8ac3bb48 How reproducible: Deterministic Steps to Reproduce: 1. qemu-img create input.img 2G 2. qemu-img create output.img 2G 3. sudo losetup -f output.img 4. qemu-img convert -t none -O raw input.img /dev/loop0 Actual results: qemu-img: error writing zeroes at sector 0: Invalid argument Expected results: Success from qemu-img convert.
*** Bug 1196698 has been marked as a duplicate of this bug. ***
Set state to modified. The patch will come into RHEL 7.2 qemu-kvm from upstream via rebase.
This same issue effects Fedora 21 as well and is displayed when trying to use OpenStack Cinder to convert Glance images. Could we backport the fix into Fedora 21 as well (it is preventing upstream CI from using Fedora ATM).
Reproduced on qemu-kvm-rhev-2.1.2-23.el7.x86_64: 1. qemu-img create input.img 2G 2. qemu-img create output.img 2G 3. sudo losetup -f output.img 4. qemu-img convert -t none -O raw input.img /dev/loop0 qemu-img: error writing zeroes at sector 0: Invalid argument Verified on qemu-kvm-1.5.3-86.el7.x86_64 and qemu-kvm-rhev-2.3.0-6.el7.x86_64: step 4 succeeds.
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. https://rhn.redhat.com/errata/RHBA-2015-2546.html