diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index a8db2e3f89044460741fe41dcb6dcadfd7b2d669..d066aae3cb6df86a1a533d85f3f062d3092be953 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -781,8 +781,15 @@ void xprt_connect(struct rpc_task *task) return; if (xprt_test_and_set_connecting(xprt)) return; - xprt->stat.connect_start = jiffies; - xprt->ops->connect(xprt, task); + /* Race breaker */ + if (!xprt_connected(xprt)) { + xprt->stat.connect_start = jiffies; + xprt->ops->connect(xprt, task); + } else { + xprt_clear_connecting(xprt); + task->tk_status = 0; + rpc_wake_up_queued_task(&xprt->pending, task); + } } xprt_release_write(xprt, task); }