Bug 1040912

Summary: [ARM] mount-local / FUSE support does not seem to work at all
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:
Bug Depends On: 1040945    
Bug Blocks:    

Description Richard W.M. Jones 2013-12-12 09:59:17 UTC
Description of problem:

(Note this only happens on ARM, not on x86).

libguestfs enters guestfs_mount_local, but this call returns
early, apparently without any error.  This leaves the FUSE
mount in a strange state without a backing transport.

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

libguestfs 1.25.13

How reproducible:

100%

Steps to Reproduce:

Use a test script like this:

------------------------------------------------
#!/bin/bash -

fusermount -u /tmp/mnt
rm -rf /tmp/mnt
set -e
mkdir /tmp/mnt

export LIBGUESTFS_HV=/home/rjones/d/qemu/arm-softmmu/qemu-system-arm
export LIBGUESTFS_DEBUG=1
export LIBGUESTFS_TRACE=1

gdir=$HOME/d/libguestfs

$gdir/run \
$gdir/fish/guestfish -a $gdir/tests/guests/fedora.img -i <<EOF
  mount-local /tmp/mnt
EOF
------------------------------------------------

Actual results:

mount_local enters and leaves very quickly, with no error:

libguestfs: trace: mount_local "/tmp/mnt"
libguestfs: guestfs__mount_local: fuse_mount /tmp/mnt
libguestfs: guestfs__mount_local: fuse_new
libguestfs: guestfs__mount_local: leaving fuse_mount_local
libguestfs: trace: mount_local = 0

Expected results:

mount_local should wait around until someone unmounts the
mountpoint using fusermount -u.

Comment 1 Richard W.M. Jones 2013-12-12 10:06:51 UTC
Sorry, that description & test is bogus, since it doesn't call
mount-local-run.

Here is an updated test case:

------------------------------------------------
#!/bin/bash -

fusermount -u /tmp/mnt
rm -rf /tmp/mnt
set -e
mkdir /tmp/mnt

export LIBGUESTFS_HV=/home/rjones/d/qemu/arm-softmmu/qemu-system-arm
export LIBGUESTFS_DEBUG=1
export LIBGUESTFS_TRACE=1

gdir=$HOME/d/libguestfs

$gdir/run \
$gdir/fish/guestfish -a $gdir/tests/guests/fedora.img -i <<EOF
  mount-local /tmp/mnt
  mount-local-run
EOF
------------------------------------------------

What happens is /tmp/mnt is created and mounted, and libguestfs
sits in the FUSE loop processing requests.  However the mount
point has strange permissions and is completely inaccessible:

$ ls -al /tmp | grep mnt
ls: cannot access /tmp/mnt: Permission denied
d??????????  ? ?      ?             ?            ? mnt
$ ls /tmp/mnt
ls: cannot access /tmp/mnt: Permission denied

So this is probably a FUSE bug?