Am 18.02.2011 schrieb Miklos Szeredi: > On Fri, 18 Feb 2011, Johannes Martin wrote: >> Subject: sshfs in combination with bind mounts and umount -f fails >> Package: sshfs >> Version: 2.2-1 >> Severity: normal >> >> *** Please type your report below this line *** >> >> If an sshfs file system is mounted, then mapped to a different location >> in the file system using a bind mount and then the bind mount is unmounted >> using the -f (force) flag (as is done for example in /etc/init.d/umountfs), >> the sshfs mount breaks: >> >> --- >> root:~/.ssh# mkdir -p /mnt/mp1 >> root:~/.ssh# mkdir -p /mnt/mp2 >> root:~/.ssh# sshfs localhost:/home /mnt/mp1 >> root:~/.ssh# mount -o bind /mnt/mp1 /mnt/mp2 >> root:~/.ssh# umount -f /mnt/mp2 >> root:~/.ssh# ls /mnt/mp1 >> ls: cannot access /mnt/mp1: Transport endpoint is not connected >> --- >> >> This is a problem when the bind mount is within a container >> (OpenVZ, lxc) and the container runs unmodified init scripts >> that unmount the bind mount with the -f flag. It leads to all >> other applications and containers to not be able to read >> from the sshfs mount any more. >> >> The problem also occurs with glusterfs, the it may be a problem >> in the fuse libraries or kernel driver. > > Yep, this is how "umount -f" is supposed to work. You'll get similar > behavior with other network filesystems: NFS, 9P, CEPH, CIFS, etc... > > Unfortunately you cannot have an unmodified rc script in the > container in these cases.
Just verified, yes, it happens with CIFS, too. With NFS it works. I don't believe this is how it is supposed to work. Why should an unmount on a bind mount affect other mounts? The docs say (man 2 umount): MNT_FORCE (since Linux 2.1.116) Force unmount even if busy. This can cause data loss. (Only for NFS mounts.) So the -f flag should only make a difference if a filesystem is busy, and even then it should not affect other mount points. I'm not unmounting the original mount and complain that the bind mount no longer works (that would in fact make sense with umount -f). It's the other way around: I'm unmounting something that happens to bind mount a directory lying on an sshfs file system to somewhere else and it causes the underlying mount to break ("mount" still lists the mount to be active, and so does "/proc/mounts"). Regards Johannes -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org