Commit feb8ca37 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Ensure that we honour autoclose before attempting to reconnect

If the XPRT_CLOSE_WAIT flag is set, we need to ensure that we call
xprt->ops->close() while holding xprt_lock_write() before we can
start reconnecting.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 22763c5c
...@@ -700,6 +700,10 @@ void xprt_connect(struct rpc_task *task) ...@@ -700,6 +700,10 @@ void xprt_connect(struct rpc_task *task)
} }
if (!xprt_lock_write(xprt, task)) if (!xprt_lock_write(xprt, task))
return; return;
if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xprt->state))
xprt->ops->close(xprt);
if (xprt_connected(xprt)) if (xprt_connected(xprt))
xprt_release_write(xprt, task); xprt_release_write(xprt, task);
else { else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment