req->rq_status = rc;
RETURN(1);
} else {
- /* here begins timeout counting */
- req->rq_sent = cfs_time_current_sec();
req->rq_wait_ctx = 1;
RETURN(0);
}
req->rq_waiting || req->rq_wait_ctx) {
int status;
- /* rq_wait_ctx is only touched in ptlrpcd,
- * no lock needed here.
- */
- if (req->rq_wait_ctx)
- goto check_ctx;
-
ptlrpc_unregister_reply(req);
spin_lock(&imp->imp_lock);
old_xid, req->rq_xid);
}
}
-check_ctx:
+ /*
+ * rq_wait_ctx is only touched by ptlrpcd,
+ * so no lock is needed here.
+ */
status = sptlrpc_req_refresh_ctx(req, -1);
if (status) {
if (req->rq_err) {
req->rq_status = status;
force_timer_recalc = 1;
- }
- if (!req->rq_wait_ctx) {
- /* begins timeout counting */
- req->rq_sent = cfs_time_current_sec();
+ } else {
req->rq_wait_ctx = 1;
}
+
continue;
} else {
- req->rq_sent = 0;
req->rq_wait_ctx = 0;
}
spin_lock(&req->rq_lock);
req->rq_timedout = 1;
- req->rq_wait_ctx = 0;
spin_unlock(&req->rq_lock);
ptlrpc_unregister_reply (req);
if (req->rq_timedout) /* already timed out */
continue;
+ if (req->rq_wait_ctx) /* waiting for ctx */
+ continue;
+
if (req->rq_phase == RQ_PHASE_NEW)
deadline = req->rq_sent;
else
if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_DROP_RPC))
RETURN(0);
- LASSERT (request->rq_type == PTL_RPC_MSG_REQUEST);
+ LASSERT(request->rq_type == PTL_RPC_MSG_REQUEST);
+ LASSERT(request->rq_wait_ctx == 0);
/* If this is a re-transmit, we're required to have disengaged
* cleanly from the previous attempt */