Skip to content

Commit

Permalink
SUNRPC: Ensure that we honour autoclose before attempting to reconnect
Browse files Browse the repository at this point in the history
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: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 3, 2009
1 parent 22763c5 commit feb8ca3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,10 @@ void xprt_connect(struct rpc_task *task)
}
if (!xprt_lock_write(xprt, task))
return;

if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xprt->state))
xprt->ops->close(xprt);

if (xprt_connected(xprt))
xprt_release_write(xprt, task);
else {
Expand Down

0 comments on commit feb8ca3

Please sign in to comment.