From d0b981991b198a37e34eda53cc94295869ef4a02 Mon Sep 17 00:00:00 2001 From: wangdi Date: Mon, 29 Aug 2005 07:22:19 +0000 Subject: [PATCH] Branch: HEAD revert back the fix for b7379, it is not right. --- lustre/llite/llite_lib.c | 15 +++++---------- lustre/mds/mds_lov.c | 14 +++----------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 3d15562..fc68447 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1039,7 +1039,7 @@ int ll_process_config_update(struct ll_sb_info *sbi, int clean) struct lustre_mount_data *lmd = sbi->ll_lmd; char *profile = lmd->lmd_profile, *name = NULL; struct config_llog_instance cfg; - int rc, namelen = 0; + int rc, namelen = 0, version; struct llog_ctxt *ctxt; ENTRY; @@ -1059,7 +1059,7 @@ int ll_process_config_update(struct ll_sb_info *sbi, int clean) OBD_ALLOC(name, namelen); if (name == NULL) RETURN(-ENOMEM); -#if 0 + if (clean) { version = sbi->ll_config_version - 1; sprintf(name, "%s-clean-%d", profile, version); @@ -1067,19 +1067,14 @@ int ll_process_config_update(struct ll_sb_info *sbi, int clean) version = sbi->ll_config_version + 1; sprintf(name, "%s-%d", profile, version); } -#else - if (clean) { - sprintf(name, "%s-clean", profile); - } else { - sprintf(name, "%s", profile); - } -#endif + CWARN("Applying configuration log %s\n", name); ctxt = llog_get_context(&sbi->ll_md_exp->exp_obd->obd_llogs, LLOG_CONFIG_REPL_CTXT); rc = class_config_process_llog(ctxt, name, &cfg); - + if (rc == 0) + sbi->ll_config_version = version; CWARN("Finished applying configuration log %s: %d\n", name, rc); if (rc == 0 && clean == 0) { diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 74acc6c..f5b0713 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -828,7 +828,7 @@ int mds_dt_update_config(struct obd_device *obd, int clean) struct config_llog_instance cfg; struct llog_ctxt *ctxt; char *profile = mds->mds_profile, *name; - int rc, namelen; + int rc, version, namelen; ENTRY; if (profile == NULL) @@ -841,7 +841,6 @@ int mds_dt_update_config(struct obd_device *obd, int clean) OBD_ALLOC(name, namelen); if (name == NULL) RETURN(-ENOMEM); -#if 0 if (clean) { version = mds->mds_config_version - 1; sprintf(name, "%s-clean-%d", profile, version); @@ -849,21 +848,14 @@ int mds_dt_update_config(struct obd_device *obd, int clean) version = mds->mds_config_version + 1; sprintf(name, "%s-%d", profile, version); } -#else - if (clean) { - sprintf(name, "%s-clean", profile); - } else { - sprintf(name, "%s", profile); - } -#warning "should add config version finally" -#endif CWARN("Applying configuration log %s\n", name); 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, &cfg); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); - + if (rc == 0) + mds->mds_config_version = version; CWARN("Finished applying configuration log %s: %d\n", name, rc); OBD_FREE(name, namelen); -- 1.8.3.1