Bug 579664 - guestfish doesn't report error when there is not enough space for image allocation
guestfish doesn't report error when there is not enough space for image alloc...
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks: 579691
  Show dependency treegraph
 
Reported: 2010-04-06 03:54 EDT by Qixiang Wan
Modified: 2011-07-14 15:23 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 579691 (view as bug list)
Environment:
Last Closed: 2011-07-14 15:23:35 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)

  None (edit)
Description Qixiang Wan 2010-04-06 03:54:23 EDT
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 05:57:42 EDT
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 06:25:27 EDT
Patch posted upstream:
https://www.redhat.com/archives/libguestfs/2010-April/msg00028.html
Comment 4 Richard W.M. Jones 2010-04-08 10:31:02 EDT
Fixed in 1.3.1.
Comment 5 Fedora Update System 2010-04-09 10:10:06 EDT
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 17:06:47 EDT
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 03:43:41 EDT
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 17:31:24 EDT
Change product to upstream (Virtualization Tools).
Comment 9 Fedora Update System 2010-04-30 19:46:50 EDT
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 05:37:25 EDT
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.