X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fptlrpc%2Fclient.c;fp=lustre%2Fptlrpc%2Fclient.c;h=bee8d3fbcf00773f7ba63f5f32ccad85ac29f7f4;hp=0182bbd812c6612936de1b43dee7a52760e0e020;hb=5e30a2c06176f50f5e17aba68fdae7e38d922d33;hpb=c6e4c21c4f8b04abc53c1010a697eb3ada4fb315 diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 0182bbd..bee8d3f 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -2741,9 +2741,6 @@ EXPORT_SYMBOL(ptlrpc_req_xid); */ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) { - int rc; - struct l_wait_info lwi; - /* * Might sleep. */ @@ -2784,24 +2781,25 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) * unlinked before returning a req to the pool. */ for (;;) { - /* The wq argument is ignored by user-space wait_event macros */ wait_queue_head_t *wq = (request->rq_set) ? &request->rq_set->set_waitq : &request->rq_reply_waitq; + int seconds = LONG_UNLINK; /* * Network access will complete in finite time but the HUGE * timeout lets us CWARN for visibility of sluggish NALs */ - lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK), - cfs_time_seconds(1), NULL, NULL); - rc = l_wait_event(*wq, !ptlrpc_client_recv_or_unlink(request), - &lwi); - if (rc == 0) { + while (seconds > 0 && + wait_event_idle_timeout( + *wq, + !ptlrpc_client_recv_or_unlink(request), + cfs_time_seconds(1)) == 0) + seconds -= 1; + if (seconds > 0) { ptlrpc_rqphase_move(request, request->rq_next_phase); RETURN(1); } - LASSERT(rc == -ETIMEDOUT); DEBUG_REQ(D_WARNING, request, "Unexpectedly long timeout receiving_reply=%d req_ulinked=%d reply_unlinked=%d", request->rq_receiving_reply,