2002-04-10 05:54:10

by minoura makoto

[permalink] [raw]
Subject: [PATCH] knfsd restart fails


The following patch for 2.5.7 will fix the problem that when
a NFS/TCP client exists attempts to restart nfsd will
(silently) fail. This is because some client implementations
(Linux, *BSD) do not immediately close the connection when
the server socket is closed, and bind() will fail
EADDRINUSE. We have to do setsockopt(SO_REUSEADDR) to cope
with them.

--
Minoura Makoto <[email protected]>
Engineering Dept., VA Linux Systems Japan

--- net/sunrpc/svcsock.c.orig Wed Mar 27 21:24:55 2002
+++ net/sunrpc/svcsock.c Wed Mar 27 21:51:43 2002
@@ -1225,6 +1225,8 @@
return error;

if (sin != NULL) {
+ if (protocol == IPPROTO_TCP)
+ sock->sk->reuse = 1;
error = sock->ops->bind(sock, (struct sockaddr *) sin,
sizeof(*sin));
if (error < 0)

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs