Skip to content

Commit 6cb2868

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Wake tasks after connect worker fails
Pending tasks are currently never awoken when the connect worker fails. The reason is that XPRT_CONNECTED is always clear after a failure return of rpcrdma_ep_connect, thus the xprt_test_and_clear_connected() check in xprt_rdma_connect_worker() always fails. - xprt_rdma_close always clears XPRT_CONNECTED. - rpcrdma_ep_connect always clears XPRT_CONNECTED. After reviewing the TCP connect worker, it appears that there's no need for extra test_and_set paranoia in xprt_rdma_connect_worker. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 614f3c9 commit 6cb2868

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

net/sunrpc/xprtrdma/transport.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,13 @@ xprt_rdma_connect_worker(struct work_struct *work)
243243
rc = rpcrdma_ep_connect(&r_xprt->rx_ep, &r_xprt->rx_ia);
244244
xprt_clear_connecting(xprt);
245245
if (r_xprt->rx_ep.rep_connected > 0) {
246-
if (!xprt_test_and_set_connected(xprt)) {
247-
xprt->stat.connect_count++;
248-
xprt->stat.connect_time += (long)jiffies -
249-
xprt->stat.connect_start;
250-
xprt_wake_pending_tasks(xprt, -EAGAIN);
251-
}
252-
} else {
253-
if (xprt_test_and_clear_connected(xprt))
254-
xprt_wake_pending_tasks(xprt, rc);
246+
xprt->stat.connect_count++;
247+
xprt->stat.connect_time += (long)jiffies -
248+
xprt->stat.connect_start;
249+
xprt_set_connected(xprt);
250+
rc = -EAGAIN;
255251
}
252+
xprt_wake_pending_tasks(xprt, rc);
256253
}
257254

258255
/**

0 commit comments

Comments
 (0)