From: Lai Siyao Date: Thu, 23 Feb 2012 08:23:25 +0000 (+0800) Subject: LU-1014 mountconf: MGS should process parameter config X-Git-Tag: 2.1.58~16 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=6cde8692384a1d3a6d0e8114629fa943c951fe40 LU-1014 mountconf: MGS should process parameter config MGS doesn't have llog config of its own, but it should process -params config which is global parameters for the whole system. Signed-off-by: Lai Siyao Change-Id: I62147dfff17f28c537d75652b49ed3582b0fa64c Reviewed-on: http://review.whamcloud.com/2139 Reviewed-by: James Simmons Tested-by: Hudson Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 49262b4..57ffa55 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -265,7 +265,7 @@ static struct config_llog_data *config_recover_log_add(struct obd_device *obd, struct config_llog_data *cld; char logname[32]; - if ((lsi->lsi_flags & LSI_SERVER) && IS_OST(lsi->lsi_ldd)) + if ((lsi->lsi_flags & LSI_SERVER) && !IS_MDT(lsi->lsi_ldd)) return NULL; /* we have to use different llog for clients and mdts for cmd diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 5618337..cea8fb2 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1603,8 +1603,23 @@ static void server_put_super(struct super_block *sb) should have put it on a different device. */ if (IS_MGS(lsi->lsi_ldd)) { /* if MDS start with --nomgs, don't stop MGS then */ - if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS)) + if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS)) { + char *logname; + + OBD_ALLOC(logname, MGS_PARAM_MAXLEN); + if (!logname) { + LCONSOLE_WARN("Stopping mgs failed %d, please " + "try again.", -ENOMEM); + return; + } + strcpy(logname, lsi->lsi_ldd->ldd_fsname); + strcat(logname, "-params"); + /* tell the mgc to drop parameter config log */ + lustre_end_log(sb, logname, NULL); + OBD_FREE(logname, MGS_PARAM_MAXLEN); + server_stop_mgs(sb); + } } /* Clean the mgc and sb */ @@ -1817,6 +1832,25 @@ static int server_fill_super(struct super_block *sb) Client will not finish until all servers are connected. Note - MGS-only server does NOT get a client, since there is no lustre fs associated - the MGS is for all lustre fs's */ + } else if (IS_MGS(lsi->lsi_ldd) && + !(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS)){ + struct config_llog_instance cfg; + char *logname; + + OBD_ALLOC(logname, MGS_PARAM_MAXLEN); + if (logname == NULL) + GOTO(out_mnt, rc = -ENOMEM); + strcpy(logname, lsi->lsi_ldd->ldd_fsname); + strcat(logname, "-params"); + + memset(&cfg, 0, sizeof(cfg)); + rc = lustre_process_log(sb, logname, &cfg); + OBD_FREE(logname, MGS_PARAM_MAXLEN); + if (rc) { + CERROR("failed to process parameters %s: %d\n", + logname, rc); + GOTO(out_mnt, rc); + } } rc = server_fill_super_common(sb);