Whamcloud - gitweb
Branch: HEAD
authorwangdi <wangdi>
Sat, 17 Sep 2005 06:40:20 +0000 (06:40 +0000)
committerwangdi <wangdi>
Sat, 17 Sep 2005 06:40:20 +0000 (06:40 +0000)
tmp fix about ost add/del, reset osc uuid in mds, but not reset mdc uuid in mds

lustre/include/linux/obd_class.h
lustre/llite/llite_lib.c
lustre/mds/mds_lov.c
lustre/obdclass/obd_config.c

index ffa3727..3c54d3c 100644 (file)
@@ -84,10 +84,12 @@ int oig_wait(struct obd_io_group *oig);
 int class_process_config(struct lustre_cfg *lcfg);
 
 /* Passed as data param to class_config_parse_handler() */
+#define CFG_MODIFY_UUID_FL 0x00001
 struct config_llog_instance {
         char *cfg_instance;
         struct obd_uuid cfg_uuid;
         ptl_nid_t cfg_local_nid;
+        int  cfg_flags;
 };
 
 int class_config_process_llog(struct llog_ctxt *ctxt, char *name,
index bad3fb3..f006c38 100644 (file)
@@ -409,12 +409,13 @@ int lustre_common_fill_super(struct super_block *sb, char *lmv, char *lov,
         if (err)
                 GOTO(out_lmv, err);
 
+        /*connect GSS*/
         err = lustre_init_crypto(sb, gkc, data, async);
         if (err) {
                 CERROR("Could not connect to GSS err %d\n", err);
                 err = 0;
         }
-        /*connect GSS*/
+        
         err = lustre_init_root_inode(sb);
         if (err)
                 GOTO(out_gks, err);
@@ -876,6 +877,7 @@ static int lustre_process_profile(struct super_block *sb,
         cfg.cfg_instance = sbi->ll_instance;
         cfg.cfg_uuid = sbi->ll_sb_uuid;
         cfg.cfg_local_nid = lmd->lmd_local_nid;
+        cfg.cfg_flags |= CFG_MODIFY_UUID_FL;
         err = lustre_process_log(lmd, lmd->lmd_profile, &cfg, 0);
         if (err < 0) {
                 CERROR("Unable to process log: %s\n", lmd->lmd_profile);
@@ -942,6 +944,7 @@ static int lustre_clean_profile(struct ll_sb_info *sbi, int force_umount)
                 
         }
         if (sbi->ll_instance != NULL) {
+                cfg.cfg_flags |= CFG_MODIFY_UUID_FL;
                 cfg.cfg_instance = sbi->ll_instance;
                 cfg.cfg_uuid = sbi->ll_sb_uuid;
 
index 4418eec..6d78907 100644 (file)
@@ -828,6 +828,7 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
         struct mds_obd *mds = &obd->u.mds;
         struct lvfs_run_ctxt saved;
         struct llog_ctxt *ctxt;
+        struct config_llog_instance cfg;
         char *profile = mds->mds_profile, *name;
          int rc, version, namelen, value;
         __u32 valsize;
@@ -835,6 +836,8 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
 
         if (profile == NULL)
                 RETURN(0);
+        cfg.cfg_instance = NULL;
+        cfg.cfg_uuid = mds->mds_dt_uuid;
 
         namelen = strlen(profile) + 20; /* -clean-######### */
         OBD_ALLOC(name, namelen);
@@ -851,9 +854,12 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
 
         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, NULL);
+        rc = class_config_process_llog(ctxt, name, &cfg);
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
-
+        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);
@@ -865,8 +871,7 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
         
         if (rc == 0)
                 mds->mds_config_version = version;
-        CWARN("Finished applying configuration log %s: %d\n", name, rc);
-
+exit:
         OBD_FREE(name, namelen);
         RETURN(rc);
 }
index a96e32b..a0b582c 100644 (file)
@@ -647,8 +647,16 @@ static int class_config_parse_handler(struct llog_handle * handle,
                                                            cfg->cfg_instance); 
                         }
                 }
-                if (cfg && (lcfg->lcfg_command == LCFG_ATTACH)) {
-                        lustre_cfg_bufs_set_string(&bufs, 2,
+
+                if (cfg && (lcfg->lcfg_command == LCFG_ATTACH)){
+                        /*Very Dirty Hack fix here, for mds add, 
+                         *the mdc in mds should not 
+                         *change uuid FIXME: Wangdi
+                         */
+                         if (memcmp(lustre_cfg_string(lcfg, 1), OBD_MDC_DEVICENAME, 
+                                    strlen(OBD_MDC_DEVICENAME)) || 
+                             (cfg->cfg_flags & CFG_MODIFY_UUID_FL))
+                                lustre_cfg_bufs_set_string(&bufs, 2,
                                                    (char *)cfg->cfg_uuid.uuid);
                 }
                 lcfg_new = lustre_cfg_new(lcfg->lcfg_command, &bufs);