#720455 [sshfs] Automatically unmount in network failure condition

Package:
sshfs
Source:
sshfs-fuse
Description:
filesystem client based on SSH File Transfer Protocol
Submitter:
Date:
2020-11-17 14:51:03 UTC
Severity:
important
Tags:
#720455#5
Date:
2013-08-22 06:24:44 UTC
From:
To:
--- Please enter the report below this line. ---
In the event of a network failure, sshfs can become
network-starved, causing programs accessing the sshfs
mount to enter uninterruptible sleep. The solution is
to kill the sshfs process; in contrast to some user
expectations, "fusermount -u /mountpoint" does not
work, since the mountpoint is still busy.

Killing sshfs is annoying at best, and impossible in some
cases (e.g., if $HOME is an sshfs, all new shells will
immediately enter uninterruptible sleep). This scenario
may be related to [1], but that bug appears to also be
associated with an issue on the kernel side.

The attached patch addresses this issue by providing a
new configuration option "-oread_timeout=N" which causes
sshfs to die (or attempt to remount if combined with
"-oremount") if its network connection becomes starved
for N seconds (in reality, the delay may be as long as
2N; eliminating this factor of two would complicate this
patch).

This simple patch protects the critical read() call to the
network socket with a select(). The call must fail only in
the event that sshfs is actually expecting network input,
which is determined by checking if the request tab
"sshfs.reqtab" is nonempty.

I have set a default value of "0" for this option, since
that changes things the least (i.e., it disables the
timeout). It may be best for this default to be nonzero.

Best,
Antonio

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571005

P.S. I have attempted to report this bug to upstream,
fuse-sshfs@lists.sourceforge.net, but that mailing
list seems to be dead and may have rejected my email.
Hopefully someone else has a better relationship with
upstream and can contact them.

Debian Release: jessie/sid
   451 unstable        www.deb-multimedia.org
   451 unstable        ftp.us.debian.org
   399 testing         ftp.us.debian.org
   200 experimental    www.deb-multimedia.org
   200 experimental    ftp.us.debian.org
   150 stable          dl.google.com
--- Package information. ---
Depends                 (Version) | Installed
=================================-+-===============
libc6                    (>= 2.4) |
libfuse2               (>= 2.8.1) |
libglib2.0-0          (>= 2.12.0) |
fuse                     (>= 2.7) |
openssh-client     (>= 1:4.6p1-1) |


Package's Recommends field is empty.

Package's Suggests field is empty.

#720455#10
Date:
2018-08-21 21:30:43 UTC
From:
To: