Whamcloud - gitweb
Branch: HEAD
[fs/lustre-release.git] / lustre / obdclass / obd_config.c
index de792fa..a0b582c 100644 (file)
@@ -640,10 +640,6 @@ static int class_config_parse_handler(struct llog_handle * handle,
                                         cfg->cfg_instance);
                                 lustre_cfg_bufs_set_string(&bufs, 0, inst_name);
                         }
-                        if (lcfg->lcfg_command == LCFG_ATTACH) {
-                                lustre_cfg_bufs_set_string(&bufs, 2,
-                                                    (char *)cfg->cfg_uuid.uuid);
-                        }
                         if (lcfg->lcfg_command == LCFG_SETUP) {
                                 /*add cfg_instance to the end of lcfg buffers*/
                                 lustre_cfg_bufs_set_string(&bufs,
@@ -652,6 +648,17 @@ static int class_config_parse_handler(struct llog_handle * handle,
                         }
                 }
 
+                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);
 
                 lcfg_new->lcfg_num   = lcfg->lcfg_num;