summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-08-13 15:33:51 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-08-17 13:05:49 -0500
commit99b1a4c32ad22024ac6198a4337aaec5ea23168f (patch)
tree75a5205e03e25118906a4fe5558a2a9bd3bc6c50 /net/sunrpc
parent6f536936b79bd4b5cea8fb0e5b8b0bce8cd1ea4a (diff)
downloadop-kernel-dev-99b1a4c32ad22024ac6198a4337aaec5ea23168f.zip
op-kernel-dev-99b1a4c32ad22024ac6198a4337aaec5ea23168f.tar.gz
SUNRPC: Fix a thinko in xs_connect()
It is rather pointless to test the value of transport->inet after calling xs_reset_transport(), since it will always be zero, and so we will never see any exponential back off behaviour. Also don't force early connections for SOFTCONN tasks. If the server disconnects us, we should respect the exponential backoff. Cc: stable@vger.kernel.org # 4.0+ Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 0030376..86ed778 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2279,13 +2279,14 @@ static void xs_connect(struct rpc_xprt *xprt, struct rpc_task *task)
WARN_ON_ONCE(!xprt_lock_connect(xprt, task, transport));
- /* Start by resetting any existing state */
- xs_reset_transport(transport);
-
- if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) {
+ if (transport->sock != NULL) {
dprintk("RPC: xs_connect delayed xprt %p for %lu "
"seconds\n",
xprt, xprt->reestablish_timeout / HZ);
+
+ /* Start by resetting any existing state */
+ xs_reset_transport(transport);
+
queue_delayed_work(rpciod_workqueue,
&transport->connect_worker,
xprt->reestablish_timeout);
OpenPOWER on IntegriCloud