cannot unmount sshfs mounts when ssh connection is lost

Bug #912153 reported by Jarl
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
sshfs-fuse (Fedora)
Fix Released
Undecided
sshfs-fuse (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The description is from https://bugzilla.redhat.com/show_bug.cgi?id=728467, I consider the description very comprehensive, so I grabed it.

fusermount -u do not work after a broken ssh connection. The invalid mountpoint
is in a strage state that locks the ls command.

How reproducible:
always

---

Steps to Reproduce:
1.mount a remote ssh filesystem with sshfs
2.lost the ssh connection (wait for ``broken pipe or missing link errors, if
you quickly plus/unplug nothing happens), then replug the cable
3.try to umount the ssf filesystem with fusermount -u

---

Actual results:
1) I mount a distant folder:
su pierre;
cd ~; mkdir test;
sshfs <email address hidden>:/home/someone test;

This mount is sucessfull and can be tested
cat test/somefile; #WORKS
touch test/someotherfile; #WORKS

2) For some reason ssh connection is lost for a long time (a cat eat a wire, I
unpluged my ethernet cable or zombies from outer space decide to do so). Then I
repear the connection (re plug the cable and kill the zoombies).

3) LS FAILS (except for the user who has mounted the filesystem)

su root;
ll /home/pierre;
freeze the terminal (Ctrl +C do NOT work, but closing the terminal window and
opening a new one is a workaround).

Using autocompletion with tab tab freeze the terminal too.

su pierre;
ll /home/pierre;
drwxr-xr-x. 2 pierre pierre 4096 5 mai 2010 Bananas
d?????????? ? ? ? ? ? test

4) UMOUNT FAILS
su pierre;
fusermount -u /home/pierre/test;
fusermount: entry for /home/pierre/test not found in /etc/mtab

But fusermount lies:
cat /etc/mtab | grep test;
<email address hidden>:/home/someone /home/pierre/test fuse.sshfs
rw,nosuid,nodev,relatime,user_id=0,group_id=0,max_read=65536 0 0

su -;
umount /home/pierre/test;
Terminal freezes but Ctrl +C works.

---

Expected results:
fusermount -u should unmount the filesystem, not freeze the terminal
ls should work
even if ssh is lost, the mounted folder must be in a state that do not generate
strage bugs.

Revision history for this message
In , Pierre (pierre-redhat-bugs) wrote :

Description of problem:
fusermount -u do not work after a broken ssh connection. The invalid mountpoint is in a strage state that locks the ls command.

---

Version-Release number of selected component (if applicable):
fusermount version: 2.8.5
SSHFS version 2.2
FUSE library version: 2.8.5
fusermount version: 2.8.5
using FUSE kernel interface version 7.12

---

How reproducible:
always

---

Steps to Reproduce:
1.mount a remote ssh filesystem with sshfs
2.lost the ssh connection (wait for ``broken pipe or missing link errors, if you quickly plus/unplug nothing happens), then replug the cable
3.try to umount the ssf filesystem with fusermount -u

---

Actual results:
1) I mount a distant folder:
su pierre;
cd ~; mkdir test;
sshfs <email address hidden>:/home/someone test;

This mount is sucessfull and can be tested
cat test/somefile; #WORKS
touch test/someotherfile; #WORKS

2) For some reason ssh connection is lost for a long time (a cat eat a wire, I unpluged my ethernet cable or zombies from outer space decide to do so). Then I repear the connection (re plug the cable and kill the zoombies).

3) LS FAILS (except for the user who has mounted the filesystem)

su root;
ll /home/pierre;
freeze the terminal (Ctrl +C do NOT work, but closing the terminal window and opening a new one is a workaround).

Using autocompletion with tab tab freeze the terminal too.

su pierre;
ll /home/pierre;
drwxr-xr-x. 2 pierre pierre 4096 5 mai 2010 Bananas
d?????????? ? ? ? ? ? test

4) UMOUNT FAILS
su pierre;
fusermount -u /home/pierre/test;
fusermount: entry for /home/pierre/test not found in /etc/mtab

But fusermount lies:
cat /etc/mtab | grep test;
<email address hidden>:/home/someone /home/pierre/test fuse.sshfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,max_read=65536 0 0

su -;
umount /home/pierre/test;
Terminal freezes but Ctrl +C works.

---

Expected results:
fusermount -u should unmount the filesystem, not freeze the terminal
ls should work
even if ssh is lost, the mounted folder must be in a state that do not generate strage bugs.

Additional info:
Workaround : reboot.

Revision history for this message
In , Peter (peter-redhat-bugs) wrote :

Hello.
Could you, please, try latest fuse-sshfs (2.3, in updates-testing). It should handle disconnects much more gracefully.

Revision history for this message
In , Pierre (pierre-redhat-bugs) wrote :

Things seems to work now ;)
Thank.

--- DETAILS ---

cd ~; mkdir test;
sshfs <email address hidden>:/home/someone test;

1) OK
cat test/somefile; #WORKS
touch test/someotherfile; #WORKS

2) ifconfig eth0 down #A zombie eat the cable

3) OK
su root;
ll /home/pierre;
drwxr-xr-x. 2 pierre pierre 4096 5 mai 2010 Bananas

su pierre
ll /home/pierre;
drwxr-xr-x. 2 pierre pierre 4096 5 mai 2010 Bananas

4)OK
su pierre;
fusermount -u /home/pierre/test;

OR

su -;
umount /home/pierre/test;

folder is sucessefully unmounted

Revision history for this message
Jarl (jarl-dk) wrote :
Revision history for this message
James Avery (avery-diku) wrote :

Still a problem in 2017, 5 years after the bug report; Running lsof, fuser -km, or even ls of the mountpoint hangs so bad that even kill -9 doesn't work on them.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sshfs-fuse (Ubuntu):
status: New → Confirmed
Revision history for this message
Ken Sharp (kennybobs) wrote :

What versions are being used?

Revision history for this message
Jarl (jarl-dk) wrote :

All version numbers can be found in the attached apport information file in comment #1.

Changed in sshfs-fuse (Fedora):
importance: Unknown → Undecided
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.