Whamcloud - gitweb
LU-1014 mountconf: MGS should process parameter config
authorLai Siyao <laisiyao@whamcloud.com>
Thu, 23 Feb 2012 08:23:25 +0000 (16:23 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 May 2012 18:45:13 +0000 (14:45 -0400)
MGS doesn't have llog config of its own, but it should process
<profile>-params config which is global parameters for the whole
system.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Signed-off-by: Bob Glossman <bogl@whamcloud.com>
Change-Id: I7c3a236fa0c24581494ba0e2a3ab40271a2e8c8f
Reviewed-on: http://review.whamcloud.com/2667
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/obd_mount.c

index 87f9207..6a8e2c7 100644 (file)
@@ -1518,8 +1518,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 */
@@ -1732,6 +1747,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);