diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-12-03 08:10:17 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-12-03 08:10:17 -0500 |
commit | feb8ca37cc3d83c07fd042509ef1e176cfeb2cfa (patch) | |
tree | c4bb6f88ae5e303e1c316efe392b407196bf33ac /net/sunrpc/xprt.c | |
parent | 22763c5cf3690a681551162c15d34d935308c8d7 (diff) | |
download | linux-3.10-feb8ca37cc3d83c07fd042509ef1e176cfeb2cfa.tar.gz linux-3.10-feb8ca37cc3d83c07fd042509ef1e176cfeb2cfa.tar.bz2 linux-3.10-feb8ca37cc3d83c07fd042509ef1e176cfeb2cfa.zip |
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index fd46d42afa8..469de292c23 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -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 { |