kernel/5135: nfs client can't reconnect tcp mounts after disconnect
>Synopsis: nfs client can't reconnect tcp mounts after disconnect
>Arrival-Date: Fri May 26 14:50:02 GMT 2006
>Originator: Jim Rees
University of Michigan CITI
System : OpenBSD 3.9
Machine : i386
The NFS client sometimes can't reconnect to the server on a tcp mount after
a disconnect. This happens when the process trying to reconnect does not
have uid=0 but tries to bind to a privileged port.
Set up an nfs server that will disconnect tcp clients after a timeout.
Solaris and Netapp servers are known to do this and I have reproduced this
bug with both. Find out what the disconnect timeout is, and if possible set
it to a small value. I use ten minutes.
Mount the server with tcp from OpenBSD. I use the following fstab entry,
but any tcp mount should work:
troy:/vol/home /home nfs rw,nosuid,-i,-3,-T,port=2049 0 0
Wait until the timeout interval has passed. Make sure there is no nfs
traffic during this interval. It is useful, but not necessary, to run
ethereal or tcpdump during this time so that you can see the disconnect
Become any user other than root. Try to "ls" or "cat" a file or directory
on the server. This will fail with "nfs server not responding."
One possible fix is to become root before calling sobind() in nfs_connect().
I have tested this and it works. I think a better solution would be to
modify sobind() so that it takes a cred argument, then use a root cred for
The error messages associated with the reconnect should also be removed,
because reconnect is normal, not an error.