Commit 9fc53ff2 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

staging: lustre: use explicit poll loop in ptlrpc_unregister_reply

replace l_wait_event() with wait_event_idle_timeout() and explicit
loop.  This approach is easier to understand.
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarPatrick Farrell <paf@cray.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0a0e5afc
...@@ -2500,7 +2500,6 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) ...@@ -2500,7 +2500,6 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
{ {
int rc; int rc;
wait_queue_head_t *wq; wait_queue_head_t *wq;
struct l_wait_info lwi;
/* Might sleep. */ /* Might sleep. */
LASSERT(!in_interrupt()); LASSERT(!in_interrupt());
...@@ -2543,16 +2542,17 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) ...@@ -2543,16 +2542,17 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
* Network access will complete in finite time but the HUGE * Network access will complete in finite time but the HUGE
* timeout lets us CWARN for visibility of sluggish NALs * timeout lets us CWARN for visibility of sluggish NALs
*/ */
lwi = LWI_TIMEOUT_INTERVAL(LONG_UNLINK * HZ, int cnt = 0;
HZ, NULL, NULL); while (cnt < LONG_UNLINK &&
rc = l_wait_event(*wq, !ptlrpc_client_recv_or_unlink(request), (rc = wait_event_idle_timeout(*wq,
&lwi); !ptlrpc_client_recv_or_unlink(request),
if (rc == 0) { HZ)) == 0)
cnt += 1;
if (rc > 0) {
ptlrpc_rqphase_move(request, request->rq_next_phase); ptlrpc_rqphase_move(request, request->rq_next_phase);
return 1; return 1;
} }
LASSERT(rc == -ETIMEDOUT);
DEBUG_REQ(D_WARNING, request, DEBUG_REQ(D_WARNING, request,
"Unexpectedly long timeout receiving_reply=%d req_ulinked=%d reply_unlinked=%d", "Unexpectedly long timeout receiving_reply=%d req_ulinked=%d reply_unlinked=%d",
request->rq_receiving_reply, request->rq_receiving_reply,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment