All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Improve the NFS/TCP reconnection code
@ 2007-11-07  0:39 Trond Myklebust
  2007-11-07  0:39 ` [PATCH 1/7] SUNRPC: Fix a race in xs_tcp_state_change() Trond Myklebust
                   ` (6 more replies)
  0 siblings, 7 replies; 37+ messages in thread
From: Trond Myklebust @ 2007-11-07  0:39 UTC (permalink / raw)
  To: Chuck Lever, Tom Talpey; +Cc: nfsv4, nfs

The following series of patches attempts to fix a problem with the
current Linux RPC client disconnect/reconnect logic in the TCP client.

Our current strategy whenever we need to disconnect from the server and
then reconnect is to force a reset of the connection (by issuing a
'special' connect(AF_UNSPEC) call that essentially causes the TCP layer
to send an RST to terminate the current connection.
This then allows us to reuse the port immediately without worrying about
TIME-WAIT states.

The problem is that RST is not supposed to be acked by the server. We
can therefore never be entirely sure that the connection was correctly
terminated on the server side. This again may cause a SYN, RST loop
when we try to reconnect since the server may think that we are trying
to reconnect from a port that is already connected.

The solution is to use a combination of the shutdown() command, and the
connect(AF_UNSPEC).

By using shutdown() to initiate the disconnection, we are able to hang
onto the socket and monitor the shutdown process via the ->state_change()
callback. Better, we can continue to receive replies on the socket until
the FIN from the server arrives to tell that it is done sending.

After the connection is shut down, we can then use the connect(AF_UNSPEC)
trick in order to reset the socket without releasing the port number. Note
that because the socket is already closed, no RST is sent to the server.
A curious side-effect of this is that the TIME-WAIT state gets moved to
a different port number. I'm not sure how to avoid this...

Cheers
  Trond

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2007-11-09 19:55 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-07  0:39 [PATCH 0/7] Improve the NFS/TCP reconnection code Trond Myklebust
2007-11-07  0:39 ` [PATCH 1/7] SUNRPC: Fix a race in xs_tcp_state_change() Trond Myklebust
2007-11-07 22:21   ` Chuck Lever
2007-11-07 22:32     ` [NFS] " Trond Myklebust
2007-11-07 23:47       ` setclientid: string in use on NFS v4 share on Debian Etch & hosts file "solution" Matt Weatherford
2007-11-09 19:55         ` J. Bruce Fields
2007-11-08 15:40       ` [NFS] [PATCH 1/7] SUNRPC: Fix a race in xs_tcp_state_change() Chuck Lever
2007-11-08 16:12         ` Trond Myklebust
2007-11-07  0:39 ` [PATCH 2/7] SUNRPC: Fix TCP rebinding logic Trond Myklebust
2007-11-07 22:48   ` Chuck Lever
2007-11-07 23:08     ` Trond Myklebust
2007-11-07 23:28       ` [NFS] " Chuck Lever
2007-11-07 23:47         ` Trond Myklebust
2007-11-09 13:35   ` Talpey, Thomas
2007-11-07  0:39 ` [PATCH 3/7] SUNRPC: Allow the client to detect if the TCP connection is closed Trond Myklebust
2007-11-09 14:04   ` Talpey, Thomas
2007-11-09 14:33     ` [NFS] " Trond Myklebust
2007-11-09 14:35       ` Talpey, Thomas
2007-11-09 14:48         ` Trond Myklebust
2007-11-09 15:25           ` Talpey, Thomas
2007-11-09 15:32             ` [NFS] " Trond Myklebust
2007-11-09 16:53               ` Talpey, Thomas
2007-11-09 17:37                 ` Trond Myklebust
2007-11-09 17:52                   ` [NFS] " Talpey, Thomas
2007-11-09 18:21                     ` Trond Myklebust
2007-11-07  0:39 ` [PATCH 4/7] SUNRPC: Use shutdown() instead of close() when disconnecting a TCP socket Trond Myklebust
2007-11-07 23:11   ` [NFS] " Chuck Lever
2007-11-07 23:59     ` Trond Myklebust
2007-11-09 13:38   ` Talpey, Thomas
2007-11-09 13:51     ` [NFS] " Trond Myklebust
2007-11-07  0:40 ` [PATCH 5/7] SUNRPC: xprt_autoclose() should not call xprt_disconnect() Trond Myklebust
2007-11-09 13:56   ` [NFS] " Talpey, Thomas
2007-11-07  0:40 ` [PATCH 6/7] SUNRPC: Make call_status()/call_decode() call xprt_force_disconnect() Trond Myklebust
2007-11-07 23:15   ` [NFS] " Chuck Lever
2007-11-07  0:40 ` [PATCH 7/7] SUNRPC: Rename xprt_disconnect() Trond Myklebust
2007-11-07 23:16   ` [NFS] " Chuck Lever
2007-11-08  0:01     ` Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.