Bug 1303231

Summary: qemu-img fails with glusterfs file smaller than 512 bytes
Product: [Fedora] Fedora Reporter: Tom Barron <tbarron>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: amit.shah, berrange, cfergeau, crobinso, dwmw2, itamar, pbonzini, rjones, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-12 20:44:37 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:

Description Tom Barron 2016-01-29 21:43:53 UTC
Description of problem:

qemu-img info gluster://192.168.124.79/volume1/<file> fails when <file> is less than 512 bytes size

Version-Release number of selected component (if applicable):

[root@localhost mnt]# rpm -q qemu-img
qemu-img-2.4.1-6.fc23.x86_64
[root@localhost mnt]# rpm -q glusterfs-libs
glusterfs-libs-3.7.6-2.fc23.x86_64


How reproducible:

100%


Steps to Reproduce:

1. Have a gluster server running on local node with one brick and zero replicas.
   Mount it to /mnt

2. Create file below 512 bytes and run qemu-image against it; observe failure; create at or above and observe success:
 
[root@localhost mnt]# pwd
/mnt

[root@localhost mnt]# truncate -s 511 demofile; qemu-img info gluster://192.168.124.79/volume1/demofile
qemu-img: Could not open 'gluster://192.168.124.79/volume1/demofile': Could not read image for determining its format: Input/output error
[root@localhost mnt]# truncate -s 512 demofile; qemu-img info gluster://192.168.124.79/volume1/demofile
image: gluster://192.168.124.79/volume1/demofile
file format: raw
virtual size: 512 (512 bytes)
disk size: 0

Actual results:

Does not work below 512 bytes.

Expected results:

Same results for files below 512 bytes as at 512 bytes or higher.


Additional info:

Comment 1 Richard W.M. Jones 2016-01-29 21:53:32 UTC
qemu has always had problems with small files like that.  In fact
libguestfs has to take special steps when you want to attach a
zero-sized drive, see:

https://github.com/libguestfs/libguestfs/blob/master/src/drives.c#L391-L428

It's worth noting that a file < 512 bytes in size probably cannot be
a valid filesystem (at least, for common file formats).  It's too small
to be a valid qcow2 file, and although it's valid for the raw format,
no real disk image could be less than 1 ordinary sector (512 bytes)
in size.  Maybe non-native formats like VMDK are different.

Comment 2 Richard W.M. Jones 2016-01-29 21:55:27 UTC
> a valid filesystem (at least, for common file formats).

I mean disk image, not filesystem.

Comment 3 Fedora End Of Life 2016-11-24 15:16:41 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Cole Robinson 2016-12-12 20:44:37 UTC
Not sure if this is still relevant for f24, but given the low impact of this, I don't think it's worth keeping it limping along in the fedora tracker. If anyone is still affected by this, please file an upstream bug, maybe one of the upstream devs will jump on it