Bug 579664 - guestfish doesn't report error when there is not enough space for image allocation
Summary: guestfish doesn't report error when there is not enough space for image alloc...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 579691
TreeView+ depends on / blocked
 
Reported: 2010-04-06 07:54 UTC by Qixiang Wan
Modified: 2011-07-14 19:23 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
: 579691 (view as bug list)
Environment:
Last Closed: 2011-07-14 19:23:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Qixiang Wan 2010-04-06 07:54:23 UTC
Description of problem:
When there is no enough space for guestfish to alloc a image file, guestfish doesn't report error.

Version-Release number of selected component (if applicable):
libguestfs-1.0.85-1.fc12.3.x86_64
guestfish-1.0.85-1.fc12.3.x86_64


How reproducible:
100%

Steps to Reproduce:
$ df -h .
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda10            4.9G  4.6G     0 100% /home

$ guestfish <<_EOF_
> alloc foo.img 10G
> _EOF_

$ echo $?
0

$ ll foo.img 
-rw-rw-r-- 1 root root 0 2010-04-06 15:43 foo.img

Actual results:
No error report for the no enough space error, and return code is 0 which stand for no error happen in guestfish.

Expected results:
guestfish should report error and return code should be non-zero in such situation. 


Additional info:

Comment 1 Richard W.M. Jones 2010-04-06 09:57:42 UTC
This is a proper bug.  posix_fallocate uses a non-standard way to
return errors.  Way to go POSIX committee.

[...]

RETURN VALUE
       posix_fallocate() returns zero on success, or an error number on  fail-
       ure.  Note that errno is not set.

Comment 2 Richard W.M. Jones 2010-04-06 10:25:27 UTC
Patch posted upstream:
https://www.redhat.com/archives/libguestfs/2010-April/msg00028.html

Comment 4 Richard W.M. Jones 2010-04-08 14:31:02 UTC
Fixed in 1.3.1.

Comment 5 Fedora Update System 2010-04-09 14:10:06 UTC
libguestfs-1.2.1-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.1-1.fc13

Comment 6 Fedora Update System 2010-04-09 21:06:47 UTC
libguestfs-1.2.1-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libguestfs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/libguestfs-1.2.1-1.fc13

Comment 7 Fedora Update System 2010-04-13 07:43:41 UTC
libguestfs-1.2.2-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.2-1.fc13

Comment 8 Richard W.M. Jones 2010-04-13 21:31:24 UTC
Change product to upstream (Virtualization Tools).

Comment 9 Fedora Update System 2010-04-30 23:46:50 UTC
libguestfs-1.2.2-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Qixiang Wan 2010-06-28 09:37:25 UTC
tested with libguestfs-1.2.2-1.fc13 on Fedora 13:

$ guestfish <<_EOF_
> alloc foo.img 10G
> _EOF_
fallocate: No space left on device
$ echo $?
1

change to VERIFIED.


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