From ba2ecf04beab65a6a4c8399c6a740999de218ece Mon Sep 17 00:00:00 2001 From: wangdi Date: Sat, 17 Sep 2005 06:40:20 +0000 Subject: [PATCH] Branch: HEAD tmp fix about ost add/del, reset osc uuid in mds, but not reset mdc uuid in mds --- lustre/include/linux/obd_class.h | 2 ++ lustre/llite/llite_lib.c | 5 ++++- lustre/mds/mds_lov.c | 13 +++++++++---- lustre/obdclass/obd_config.c | 12 ++++++++++-- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index ffa3727..3c54d3c 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -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, diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index bad3fb3..f006c38 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -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; diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 4418eec..6d78907 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -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); } diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index a96e32b..a0b582c 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -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); -- 1.8.3.1