Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Fri, 30 May 2008 02:56:38 +0000 (02:56 +0000)
committerbobijam <bobijam>
Fri, 30 May 2008 02:56:38 +0000 (02:56 +0000)
b=14134
i=nathan, johann

Description: enable MGS and MDT services start separately
Details    : add a 'nomgs' option in mount.lustre to enable start a MDT with
             a co-located MGS without starting the MGS, which is a complement
             to 'nosvc' mount option.

lustre/ChangeLog
lustre/doc/mount.lustre.8
lustre/include/lustre_disk.h
lustre/obdclass/obd_mount.c
lustre/tests/conf-sanity.sh
lustre/utils/mount_lustre.c

index de18065..e2e84e3 100644 (file)
@@ -12,6 +12,13 @@ tbd  Sun Microsystems, Inc.
        * RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a
         removed cwd "./" (refer to Bugzilla 14399).
 
        * RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a
         removed cwd "./" (refer to Bugzilla 14399).
 
+Severity   : major
+Bugzilla   : 14134
+Description: enable MGS and MDT services start separately
+Details    : add a 'nomgs' option in mount.lustre to enable start a MDT with
+             a co-located MGS without starting the MGS, which is a complement
+             to 'nosvc' mount option.
+
 Severity   : normal
 Frequency  : always with o2ib 1.3 and sles10
 Bugzilla   : 15870
 Severity   : normal
 Frequency  : always with o2ib 1.3 and sles10
 Bugzilla   : 15870
index ae3c842..4980db3 100644 (file)
@@ -96,6 +96,9 @@ options:
 .BI nosvc
 Only start the MGC (and MGS, if co-located) for a target service, and not the actual service.
 .TP
 .BI nosvc
 Only start the MGC (and MGS, if co-located) for a target service, and not the actual service.
 .TP
+.BI nomgs
+Start a MDT with a co-located MGS without starting the MGS.
+.TP
 .BI exclude= ostlist
 Start a client or MDT with a (colon-separated) list of known inactive OSTs.
 .TP
 .BI exclude= ostlist
 Start a client or MDT with a (colon-separated) list of known inactive OSTs.
 .TP
index 98ede40..00eeca0 100644 (file)
@@ -151,6 +151,8 @@ struct lustre_mount_data {
 #define LMD_FLG_ABORT_RECOV  0x0008  /* Abort recovery */
 #define LMD_FLG_NOSVC        0x0010  /* Only start MGS/MGC for servers, 
                                         no other services */
 #define LMD_FLG_ABORT_RECOV  0x0008  /* Abort recovery */
 #define LMD_FLG_NOSVC        0x0010  /* Only start MGS/MGC for servers, 
                                         no other services */
+#define LMD_FLG_NOMGS        0x0020  /* Only start target for servers, reusing
+                                        existing MGS services */
 
 #define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT) 
 
 
 #define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT) 
 
index db8ca47..8ed47c9 100644 (file)
@@ -763,8 +763,8 @@ static int lustre_stop_mgc(struct super_block *sb)
         obd = lsi->lsi_mgc;
         if (!obd)
                 RETURN(-ENOENT);
         obd = lsi->lsi_mgc;
         if (!obd)
                 RETURN(-ENOENT);
-
         lsi->lsi_mgc = NULL;
         lsi->lsi_mgc = NULL;
+
         mutex_down(&mgc_start_lock);
         if (!atomic_dec_and_test(&obd->u.cli.cl_mgc_refcount)) {
                 /* This is not fatal, every client that stops
         mutex_down(&mgc_start_lock);
         if (!atomic_dec_and_test(&obd->u.cli.cl_mgc_refcount)) {
                 /* This is not fatal, every client that stops
@@ -1357,7 +1357,8 @@ static void server_put_super(struct super_block *sb)
         CDEBUG(D_MOUNT, "server put_super %s\n", tmpname);
 
         /* Stop the target */
         CDEBUG(D_MOUNT, "server put_super %s\n", tmpname);
 
         /* Stop the target */
-        if (IS_MDT(lsi->lsi_ldd) || IS_OST(lsi->lsi_ldd)) {
+        if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOSVC) && 
+            (IS_MDT(lsi->lsi_ldd) || IS_OST(lsi->lsi_ldd))) {
                 struct lustre_profile *lprof = NULL;
 
                 /* tell the mgc to drop the config log */
                 struct lustre_profile *lprof = NULL;
 
                 /* tell the mgc to drop the config log */
@@ -1393,7 +1394,9 @@ static void server_put_super(struct super_block *sb)
                 /* stop the mgc before the mgs so the connection gets cleaned
                    up */
                 lustre_stop_mgc(sb);
                 /* stop the mgc before the mgs so the connection gets cleaned
                    up */
                 lustre_stop_mgc(sb);
-                server_stop_mgs(sb);
+                /* if MDS start with --nomgs, don't stop MGS then */
+                if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS))
+                        server_stop_mgs(sb);
         }
 
         /* Clean the mgc and sb */
         }
 
         /* Clean the mgc and sb */
@@ -1569,7 +1572,7 @@ static int server_fill_super(struct super_block *sb)
         }
 
         /* start MGS before MGC */
         }
 
         /* start MGS before MGC */
-        if (IS_MGS(lsi->lsi_ldd)) {
+        if (IS_MGS(lsi->lsi_ldd) && !(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS)) {
                 rc = server_start_mgs(sb);
                 if (rc)
                         GOTO(out_mnt, rc);
                 rc = server_start_mgs(sb);
                 if (rc)
                         GOTO(out_mnt, rc);
@@ -1807,6 +1810,9 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
                 } else if (strncmp(s1, "nosvc", 5) == 0) {
                         lmd->lmd_flags |= LMD_FLG_NOSVC;
                         clear++;
                 } else if (strncmp(s1, "nosvc", 5) == 0) {
                         lmd->lmd_flags |= LMD_FLG_NOSVC;
                         clear++;
+                } else if (strncmp(s1, "nomgs", 5) == 0) {
+                        lmd->lmd_flags |= LMD_FLG_NOMGS;
+                        clear++;
                 /* ost exclusion list */
                 } else if (strncmp(s1, "exclude=", 8) == 0) {
                         rc = lmd_make_exclusion(lmd, s1 + 7);
                 /* ost exclusion list */
                 } else if (strncmp(s1, "exclude=", 8) == 0) {
                         rc = lmd_make_exclusion(lmd, s1 + 7);
index 8622648..06b00ec 100644 (file)
@@ -1559,6 +1559,27 @@ test_39() {
 }
 run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
 
 }
 run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
 
+test_40() { #bug 14134
+        local rc
+        start mds $MDSDEV $MDS_MOUNT_OPTS -o nosvc
+        start ost `ostdevname 1` $OST_MOUNT_OPTS
+        start mds $MDSDEV $MDS_MOUNT_OPTS -o nomgs
+        mkdir -p $MOUNT
+        mount_client $MOUNT || return 1
+        sleep 5
+
+        echo "blah blah" > $MOUNT/$tfile
+        cat $MOUNT/$tfile
+
+        umount_client $MOUNT
+        stop ost -f || return 201
+        stop mds -f || return 202
+        stop mds -f || return 203
+        unload_modules || return 204
+        return $rc
+}
+run_test 40 "mount mds with --nosvc and --nomgs"
+
 umount_client $MOUNT
 cleanup_nocli
 cleanup_gss
 umount_client $MOUNT
 cleanup_nocli
 cleanup_gss
index c0905bc..12313a3 100644 (file)
@@ -69,6 +69,7 @@ void usage(FILE *out)
                 "\t<mntopt>: one or more comma separated of:\n"
                 "\t\t(no)flock,(no)user_xattr,(no)acl\n"
                 "\t\tnosvc: only start MGC/MGS obds\n"
                 "\t<mntopt>: one or more comma separated of:\n"
                 "\t\t(no)flock,(no)user_xattr,(no)acl\n"
                 "\t\tnosvc: only start MGC/MGS obds\n"
+                "\t\tnomgs: only start target obds, using existing MGS\n"
                 "\t\texclude=<ostname>[:<ostname>] : colon-separated list of "
                 "inactive OSTs (e.g. lustre-OST0001)\n"
                 );
                 "\t\texclude=<ostname>[:<ostname>] : colon-separated list of "
                 "inactive OSTs (e.g. lustre-OST0001)\n"
                 );