Whamcloud - gitweb
Branch: HEAD
[fs/lustre-release.git] / lustre / mds / mds_lov.c
index 1099a2d..6d78907 100644 (file)
@@ -655,6 +655,8 @@ int mds_dt_synchronize(void *data)
         down(&mds->mds_orphan_recovery_sem);
 
         uuid = &watched->u.cli.cl_import->imp_target_uuid;
+        CWARN("MDS %s: %s now active, repairing the connection\n",
+              obd->obd_name, uuid->uuid);
 
         group = FILTER_GROUP_FIRST_MDS + mds->mds_num;
         rc = obd_set_info(watched->obd_self_export, strlen("mds_conn"),
@@ -825,15 +827,15 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
 {
         struct mds_obd *mds = &obd->u.mds;
         struct lvfs_run_ctxt saved;
-        struct config_llog_instance cfg;
         struct llog_ctxt *ctxt;
+        struct config_llog_instance cfg;
         char *profile = mds->mds_profile, *name;
-        int rc, namelen;
+         int rc, version, namelen, value;
+        __u32 valsize;
         ENTRY;
 
         if (profile == NULL)
                 RETURN(0);
-
         cfg.cfg_instance = NULL;
         cfg.cfg_uuid = mds->mds_dt_uuid;
 
@@ -841,7 +843,6 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
         OBD_ALLOC(name, namelen);
         if (name == NULL)
                 RETURN(-ENOMEM);
-#if 0
         if (clean) {
                 version = mds->mds_config_version - 1;
                 sprintf(name, "%s-clean-%d", profile, version);
@@ -849,24 +850,28 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
                 version = mds->mds_config_version + 1;
                 sprintf(name, "%s-%d", profile, version);
         }
-#else
-        if (clean) {
-                sprintf(name, "%s-clean", profile);
-        } else {
-                sprintf(name, "%s", profile);
-        }
-#warning "should add config version finally"
-#endif
         CWARN("Applying configuration log %s\n", name);
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         ctxt = llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
         rc = class_config_process_llog(ctxt, name, &cfg);
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
-        if (rc == 0)
-                mds->mds_config_version = version;
         CWARN("Finished applying configuration log %s: %d\n", name, rc);
+        if (rc != 0) { 
+                GOTO(exit, rc);
+        }
+        /* retrieve size of EA */
+        rc = obd_get_info(mds->mds_md_exp, strlen("mdsize"),
+                          "mdsize", &valsize, &value);
+        
+        if (value > mds->mds_max_mdsize)
+                mds->mds_max_mdsize = value;
 
+        CDEBUG(D_INFO, "mds max md size %d \n", mds->mds_max_mdsize);
+        
+        if (rc == 0)
+                mds->mds_config_version = version;
+exit:
         OBD_FREE(name, namelen);
         RETURN(rc);
 }