/* Either we've been evicted, or the server has failed for
* some reason. Try to reconnect, and if that fails, punt to
* the upcall. */
- if (rc == -ENOTCONN || rc == -ENODEV) {
+ if (ll_rpc_recoverable_error(rc)) {
if (req->rq_send_state != LUSTRE_IMP_FULL ||
imp->imp_obd->obd_no_recov || imp->imp_dlm_fake) {
- RETURN(-ENOTCONN);
+ RETURN(rc);
}
ptlrpc_request_handle_notconn(req);
RETURN(rc);
ENTRY;
LASSERT(req->rq_phase == RQ_PHASE_NEW);
+ if (req->rq_sent && (req->rq_sent > CURRENT_SECONDS))
+ RETURN (0);
+
req->rq_phase = RQ_PHASE_RPC;
imp = req->rq_import;
ptlrpc_send_new_req(req)) {
force_timer_recalc = 1;
}
+ /* delayed send - skip */
+ if (req->rq_phase == RQ_PHASE_NEW && req->rq_sent)
+ continue;
if (!(req->rq_phase == RQ_PHASE_RPC ||
req->rq_phase == RQ_PHASE_BULK ||
/* request in-flight? */
if (!((req->rq_phase == RQ_PHASE_RPC && !req->rq_waiting) ||
- (req->rq_phase == RQ_PHASE_BULK)))
+ (req->rq_phase == RQ_PHASE_BULK) ||
+ (req->rq_phase == RQ_PHASE_NEW)))
continue;
if (req->rq_timedout) /* already timed out */
continue;
- deadline = req->rq_sent + req->rq_timeout;
+ if (req->rq_phase == RQ_PHASE_NEW)
+ deadline = req->rq_sent;
+ else
+ deadline = req->rq_sent + req->rq_timeout;
+
if (deadline <= now) /* actually expired already */
timeout = 1; /* ASAP */
else if (timeout == 0 || timeout > deadline - now)