From: hongchao.zhang Date: Thu, 28 Jul 2011 05:43:59 +0000 (+0800) Subject: LU-350 fix bug in mgs to allow starting OST before MDT X-Git-Tag: 2.1.0-RC0~26 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3227436e11b4bc77ffd261e8f13adf905fae2353;hp=37eeb0ffd0325c5a3c426d6ab0e72ef6da84db99 LU-350 fix bug in mgs to allow starting OST before MDT in mgs_steal_llog_for_mdt_from_client, it forgets to add the "index" and "svname" of the existing OST to the config log of the MDT's lov, then cause Lustre fails to mount if the OSTs start before MDT. Change-Id: I0e68bf51c88517dbd42790e7e4447a186cf268f3 Signed-off-by: Hongchao Zhang Reviewed-on: http://review.whamcloud.com/595 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Yu Jian Reviewed-by: Oleg Drokin --- diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index a8bb398..4c64911 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -1125,6 +1125,8 @@ static int mgs_steal_llog_handler(struct llog_handle *llh, if (!strncmp(marker->cm_comment,"add osc",7) && (marker->cm_flags & CM_START)){ got_an_osc_or_mdc = 1; + strncpy(tmti->mti_svname, marker->cm_tgtname, + sizeof(tmti->mti_svname)); rc = record_start_log(obd, &mdt_llh, mti->mti_svname); rc = record_marker(obd, mdt_llh, fsdb, CM_START, mti->mti_svname,"add osc(copied)"); @@ -1202,12 +1204,21 @@ static int mgs_steal_llog_handler(struct llog_handle *llh, } if (lcfg->lcfg_command == LCFG_LOV_ADD_OBD) { + int index; char mdt_index[9]; char *logname, *lovname; - name_create_mdt_and_lov(&logname, &lovname, fsdb, mti->mti_stripe_index); + name_create_mdt_and_lov(&logname, &lovname, fsdb, + mti->mti_stripe_index); sprintf(mdt_index, "-MDT%04x", mti->mti_stripe_index); + if (sscanf(lustre_cfg_buf(lcfg, 2), "%d", &index) != 1) { + name_destroy(&logname); + name_destroy(&lovname); + RETURN(-EINVAL); + } + + tmti->mti_stripe_index = index; mgs_write_log_osc_to_lov(obd, fsdb, tmti, logname, mdt_index, lovname, LUSTRE_SP_MDT, 0);