Whamcloud - gitweb
Branch b1_4_mountconf
authornathan <nathan>
Wed, 23 Nov 2005 19:50:31 +0000 (19:50 +0000)
committernathan <nathan>
Wed, 23 Nov 2005 19:50:31 +0000 (19:50 +0000)
b=8007
add imp->imp_initial_recov_bk flag: retry/recov until all connections have
been tried, then give up.

lustre/obdclass/obd_mount.c
lustre/ptlrpc/import.c

index b6c7f43..f6587f8 100644 (file)
@@ -345,7 +345,7 @@ int lustre_get_process_log(struct super_block *sb, char *profile,
         struct lustre_handle mgc_conn = {0, };
         struct obd_export *exp = NULL;
         struct llog_ctxt *rctxt, *lctxt;
-        int allow_recov = 0;
+        int recov_bk = 1;
         int rc;
         LASSERT(mgc);
 
@@ -363,10 +363,12 @@ int lustre_get_process_log(struct super_block *sb, char *profile,
         
         /* Don't retry if connect fails */
         rc = obd_set_info(mgc->obd_self_export,
-                          strlen("initial_recov"), "initial_recov",
-                          sizeof(allow_recov), &allow_recov);
-        if (rc)
+                          strlen("init_recov_bk"), "init_recov_bk",
+                          sizeof(recov_bk), &recov_bk);
+        if (rc) {
+                CERROR("can't set init_recov_bk %d\n", rc);
                 goto out;
+        }
 
         rc = obd_connect(&mgc_conn, mgc, &(mgc->obd_uuid), NULL);
         if (rc) {
index 7c63ae6..029e13f 100644 (file)
@@ -355,6 +355,18 @@ int ptlrpc_connect_import(struct obd_import *imp, char * new_uuid)
         if (rc)
                 GOTO(out, rc);
 
+        if (imp->imp_initial_recov_bk && initial_connect &&
+            /* last in list */
+            (imp->imp_conn_current->oic_item.next == &imp->imp_conn_list)) {
+                CERROR("Last connection (%d) for %s, turning off init_recov\n",
+                       imp->imp_conn_cnt, imp->imp_target_uuid.uuid);
+                /* Don't retry if connect fails */
+                rc = 0;
+                obd_set_info(obd->obd_self_export,
+                             strlen("initial_recov"), "initial_recov",
+                             sizeof(rc), &rc);
+        }
+
         rc = obd_reconnect(imp->imp_obd->obd_self_export, obd,
                            &obd->obd_uuid, &imp->imp_connect_data);
         if (rc)