All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] SUNRPC: Clean up port reuse behavior on reconnects
@ 2018-05-10  6:12 Vallish Vaidyeshwara
  2018-05-10  6:12 ` [PATCH 1/2] SUNRPC: Need to reuse non-reserved port for reconnect Vallish Vaidyeshwara
  2018-05-10  6:12 ` [PATCH 2/2] SUNRPC: Reconnect with new port on server initiated connection termination Vallish Vaidyeshwara
  0 siblings, 2 replies; 10+ messages in thread
From: Vallish Vaidyeshwara @ 2018-05-10  6:12 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker, jlayton, bfields, linux-nfs; +Cc: jsstraus

We have seen examples of NFSv4 client reconnections failing due to
client source port reuse combined with stateful TCP state tracking in
middleboxes.

Commit 0f7a622ca616 ("rpc: xs_bind - do not bind when requesting a
random ephemeral port"), commit 4dda9c8a5e34 ("SUNRPC: Set SO_REUSEPORT
socket option for TCP connections"), and commit 1f4c17a03ba7 ("SUNRPC:
Handle EADDRNOTAVAIL on connection failures") had unintended side effects
of making port reuse dependent on whether that client uses reserved or
non-reserved source ports.

This series fixes the observed NFSv4 client reconnect failures by
choosing a new source port regardless of which port range is in use
for RST or FIN terminating the prior connection. This series does
not restore the original always-reuse behavior that existed prior to
commits mentioned above.

Patch 1:
--------
SUNRPC: Need to reuse non-reserved port for reconnect

This patch restores the original behavior of port reuse in all
scenarios.

Patch 2:
--------
SUNRPC: Reconnect with new port on server initiated connection
    termination

Client uses a new port only in cases where server has terminated
the connection explicitly using RST or FIN.

Proposed outcome with this patch series:
----------------------------------------
------------------------------------------------------------------
| Port type | Connection termination | Current    | With this    |
|           |         type           | behavior   | patch series |
------------------------------------------------------------------
|  Reserved | Network partition-DROP | Reuse port | Reuse port   |
------------------------------------------------------------------
|  Reserved | FIN from server        | Reuse port | New port     |
------------------------------------------------------------------
|  Reserved | RST from server        | Reuse port | New port     |
------------------------------------------------------------------
|  Non-Resv | Network partition-DROP | New port   | Reuse port   |
------------------------------------------------------------------
|  Non-Resv | FIN from server        | New port   | New port     |
------------------------------------------------------------------
|  Non-Resv | RST from server        | New port   | New port     |
------------------------------------------------------------------

 net/sunrpc/xprtsock.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

-- 
2.7.3.AMZN


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

end of thread, other threads:[~2018-05-10 21:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10  6:12 [PATCH 0/2] SUNRPC: Clean up port reuse behavior on reconnects Vallish Vaidyeshwara
2018-05-10  6:12 ` [PATCH 1/2] SUNRPC: Need to reuse non-reserved port for reconnect Vallish Vaidyeshwara
2018-05-10 21:18   ` Vallish Vaidyeshwara
2018-05-10  6:12 ` [PATCH 2/2] SUNRPC: Reconnect with new port on server initiated connection termination Vallish Vaidyeshwara
2018-05-10 15:25   ` Trond Myklebust
2018-05-10 16:22     ` Vallish Vaidyeshwara
2018-05-10 17:26       ` Trond Myklebust
2018-05-10 21:12         ` Vallish Vaidyeshwara
2018-05-10 17:37       ` bfields
2018-05-10 21:15         ` Vallish Vaidyeshwara

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.