Bug 1220751

Summary: fusermount returns EBUSY, but unmounts the disk anyway, confusing guestunmount
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano
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: 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 Richard W.M. Jones 2015-05-12 10:47:02 UTC
Description of problem:

Reported upstream here:
http://sourceforge.net/p/fuse/mailman/message/34104950/

'fusermount -u /mp' reports the error:

  fusermount: failed to unmount /mp: Device or resource busy

and returns a non-zero exit code, but the mountpoint is unmounted
anyway.

This new behaviour confuses guestunmount, since it expects that
fusermount will either succeed and unmount; or fail and not unmount.

That in turn breaks the fuse/test-fuse-umount-race.sh test
in the test suite.

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

libguestfs 1.29.41
fuse-2.9.3-4.fc22.x86_64

Fails with both 4.0.0-0.rc6.git2.1.fc23.x86_64 and
3.18.8-201.fc21.x86_64.

How reproducible:

Not 100%, but quite often when you run the libguestfs test
suite like this:

$ cd fuse
$ ../run ./test-fuse-umount-race.sh 

Steps to Reproduce:
1. See above.

Actual results:

$ ../run ./test-fuse-umount-race.sh 
lt-guestunmount: running: fusermount -u mp
fusermount: failed to unmount /home/rjones/d/libguestfs/fuse/mp: Device or resource busy
lt-guestunmount: running: fusermount -u mp
fusermount: entry for /home/rjones/d/libguestfs/fuse/mp not found in /etc/mtab
lt-guestunmount: mp is not mounted: fusermount: entry for /home/rjones/d/libguestfs/fuse/mp not found in /etc/mtab
$ echo $?
2