|
From: Miklos S. <mi...@sz...> - 2011-01-24 19:25:49
|
On Fri, 21 Jan 2011, Thue Janus Kristensen wrote: > If I have an SSHFS-mounted filesystem and the established sftp-connection > becomes invalid, for example if I restart my router, SSHFS bugs out. For > example, if I try to do a ls of the mounted directory, the ls hangs forever. > > Why doesn't SSHFS automatically unmount the now invalid mount point, or at > least return a read error to ls? SSHFS doesn't know, it uses ssh, which in turns uses TCP sockets, which behave badly in the presense of dynamic IP. The solution would be to give sshfs a timeout after which it kills the hanging ssh connection and starts up a new one. Returning an error may not be the right thing, the network might just be down temporarily. Unfortunately there's no way to differentiate a temporary network outage from a changed IP address in the router, which will cause TCP connections to hang "permanently". Thanks, Miklos |