- /* Report service time estimate for future client reqs, but report 0
- * (to be ignored by client) if it's a error reply during recovery.
- * (bz15815) */
- if (req->rq_type == PTL_RPC_MSG_ERR &&
- (req->rq_export == NULL || req->rq_export->exp_obd->obd_recovering))
- lustre_msg_set_timeout(req->rq_repmsg, 0);
- else
- lustre_msg_set_timeout(req->rq_repmsg,
- at_get(&svcpt->scp_at_estimate));
-
- if (req->rq_reqmsg &&
- !(lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)) {
- CDEBUG(D_ADAPTTO, "No early reply support: flags=%#x "
- "req_flags=%#x magic=%d:%x/%x len=%d\n",
- flags, lustre_msg_get_flags(req->rq_reqmsg),
- lustre_msg_is_v1(req->rq_reqmsg),
- lustre_msg_get_magic(req->rq_reqmsg),
- lustre_msg_get_magic(req->rq_repmsg), req->rq_replen);
- }
+ /* Report service time estimate for future client reqs, but report 0
+ * (to be ignored by client) if it's an error reply during recovery.
+ * b=15815
+ */
+ if (req->rq_type == PTL_RPC_MSG_ERR &&
+ (req->rq_export == NULL ||
+ req->rq_export->exp_obd->obd_recovering)) {
+ lustre_msg_set_timeout(req->rq_repmsg, 0);
+ } else {
+ time64_t timeout;
+
+ if (req->rq_export && req->rq_reqmsg != NULL &&
+ (flags & PTLRPC_REPLY_EARLY) &&
+ lustre_msg_get_flags(req->rq_reqmsg) &
+ (MSG_REPLAY | MSG_REQ_REPLAY_DONE | MSG_LOCK_REPLAY_DONE)) {
+ struct obd_device *exp_obd = req->rq_export->exp_obd;
+
+ timeout = ktime_get_real_seconds() -
+ req->rq_arrival_time.tv_sec +
+ min_t(time64_t, at_extra,
+ exp_obd->obd_recovery_timeout / 4);
+ } else {
+ timeout = at_get(&svcpt->scp_at_estimate);
+ }
+ lustre_msg_set_timeout(req->rq_repmsg, timeout);
+ }
+
+ if (req->rq_reqmsg &&
+ !(lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)) {
+ CDEBUG(D_ADAPTTO, "No early reply support: flags=%#x "
+ "req_flags=%#x magic=%x/%x len=%d\n",
+ flags, lustre_msg_get_flags(req->rq_reqmsg),
+ lustre_msg_get_magic(req->rq_reqmsg),
+ lustre_msg_get_magic(req->rq_repmsg), req->rq_replen);
+ }