From 4d8b0ec81841610045b440fd0582266ef98191f4 Mon Sep 17 00:00:00 2001
From: ericm <ericm>
Date: Tue, 15 Apr 2008 21:11:16 +0000
Subject: [PATCH] branch: b1_6 fix AT time calculation in AT_OFF mode. b=3055
 r=nathan r=rread

---
 lustre/include/obd_support.h | 2 +-
 lustre/ldlm/ldlm_lib.c       | 3 ++-
 lustre/ptlrpc/pinger.c       | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h
index 6dcb0d90d8..e97b58d908 100644
--- a/lustre/include/obd_support.h
+++ b/lustre/include/obd_support.h
@@ -60,7 +60,7 @@ extern unsigned int obd_alloc_fail_rate;
 #endif
 /* Time to wait for all clients to reconnect during recovery */
 /* Should be very conservative; must catch the first reconnect after reboot */
-#define OBD_RECOVERY_FACTOR (5 / 2) /* times obd_timeout */
+#define OBD_RECOVERY_FACTOR (3) /* times obd_timeout */
 /* Change recovery-small 26b time if you change this */
 #define PING_INTERVAL max(obd_timeout / 4, 1U)
 /* Client may skip 1 ping; we must wait at least 2.5. But for multiple
diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c
index e134fbe8c6..b17366e402 100644
--- a/lustre/ldlm/ldlm_lib.c
+++ b/lustre/ldlm/ldlm_lib.c
@@ -1282,7 +1282,8 @@ static void process_recovery_queue(struct obd_device *obd)
                 DEBUG_REQ(D_HA, req, "processing: ");
                 (void)obd->obd_recovery_handler(req);
                 obd->obd_replayed_requests++;
-                reset_recovery_timer(obd, 2 * /* safety */
+                reset_recovery_timer(obd, OBD_RECOVERY_FACTOR *
+                       AT_OFF ? obd_timeout :
                        at_get(&req->rq_rqbd->rqbd_service->srv_at_estimate), 1);
                 /* bug 1580: decide how to properly sync() in recovery */
                 //mds_fsync_super(obd->u.obt.obt_sb);
diff --git a/lustre/ptlrpc/pinger.c b/lustre/ptlrpc/pinger.c
index 32bd0ea9f4..59ccff3ba2 100644
--- a/lustre/ptlrpc/pinger.c
+++ b/lustre/ptlrpc/pinger.c
@@ -70,6 +70,7 @@ void ptlrpc_update_next_ping(struct obd_import *imp)
         int time = PING_INTERVAL;
         if (imp->imp_state == LUSTRE_IMP_DISCON) {
                 int dtime = max_t(int, CONNECTION_SWITCH_MIN,
+                                  AT_OFF ? 0 :
                                   at_get(&imp->imp_at.iat_net_latency));
                 time = min(time, dtime);
         }
-- 
GitLab