Whamcloud - gitweb
Branch: HEAD
[fs/lustre-release.git] / lustre / obdclass / obd_config.c
index 282f6c0..a0b582c 100644 (file)
@@ -355,10 +355,6 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg)
                 RETURN(-EINVAL);
         }
 
-        if (LUSTRE_CFG_BUFLEN(lcfg, 2) != sizeof(int)) {
-                CERROR("invalid priority\n");
-                RETURN(-EINVAL);
-        }
         if (strcmp(obd->obd_type->typ_name, OBD_MDC_DEVICENAME) &&
             strcmp(obd->obd_type->typ_name, OBD_OSC_DEVICENAME)) {
                 CERROR("can't add connection on non-client dev\n");
@@ -644,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,
@@ -656,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;