aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index fd46d42afa89..42f09ade0044 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -46,6 +46,7 @@
46 46
47#include <linux/sunrpc/clnt.h> 47#include <linux/sunrpc/clnt.h>
48#include <linux/sunrpc/metrics.h> 48#include <linux/sunrpc/metrics.h>
49#include <linux/sunrpc/bc_xprt.h>
49 50
50#include "sunrpc.h" 51#include "sunrpc.h"
51 52
@@ -700,6 +701,10 @@ void xprt_connect(struct rpc_task *task)
700 } 701 }
701 if (!xprt_lock_write(xprt, task)) 702 if (!xprt_lock_write(xprt, task))
702 return; 703 return;
704
705 if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xprt->state))
706 xprt->ops->close(xprt);
707
703 if (xprt_connected(xprt)) 708 if (xprt_connected(xprt))
704 xprt_release_write(xprt, task); 709 xprt_release_write(xprt, task);
705 else { 710 else {
@@ -1028,21 +1033,16 @@ void xprt_release(struct rpc_task *task)
1028 if (req->rq_release_snd_buf) 1033 if (req->rq_release_snd_buf)
1029 req->rq_release_snd_buf(req); 1034 req->rq_release_snd_buf(req);
1030 1035
1031 /*
1032 * Early exit if this is a backchannel preallocated request.
1033 * There is no need to have it added to the RPC slot list.
1034 */
1035 if (is_bc_request)
1036 return;
1037
1038 memset(req, 0, sizeof(*req)); /* mark unused */
1039
1040 dprintk("RPC: %5u release request %p\n", task->tk_pid, req); 1036 dprintk("RPC: %5u release request %p\n", task->tk_pid, req);
1037 if (likely(!is_bc_request)) {
1038 memset(req, 0, sizeof(*req)); /* mark unused */
1041 1039
1042 spin_lock(&xprt->reserve_lock); 1040 spin_lock(&xprt->reserve_lock);
1043 list_add(&req->rq_list, &xprt->free); 1041 list_add(&req->rq_list, &xprt->free);
1044 rpc_wake_up_next(&xprt->backlog); 1042 rpc_wake_up_next(&xprt->backlog);
1045 spin_unlock(&xprt->reserve_lock); 1043 spin_unlock(&xprt->reserve_lock);
1044 } else
1045 xprt_free_bc_request(req);
1046} 1046}
1047 1047
1048/** 1048/**