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,
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);
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);
}
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;
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;
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);
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);
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);
}
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);