Whamcloud - gitweb
LU-16385 obdlcass: stop MGC before MGS 78/49378/4
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 12 Dec 2022 13:35:41 +0000 (16:35 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 13 Jan 2023 07:22:50 +0000 (07:22 +0000)
drops a reference to MGC when MGS is being umounted so that
MGC doesn't try to disconnected from a missing MGS which
can take long and hurt HA.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ib15f1ca56c47201bf6e29c12b3f81a11e55944ca
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49378
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/include/lustre_disk.h
lustre/obdclass/obd_mount.c
lustre/target/tgt_mount.c

index cad22a3..753a56f 100644 (file)
@@ -373,6 +373,7 @@ int target_name2index(const char *svname, u32 *idx, const char **endptr);
 int lustre_put_lsi(struct super_block *sb);
 int lustre_start_simple(char *obdname, char *type, char *uuid,
                        char *s1, char *s2, char *s3, char *s4);
+int lustre_stop_mgc(struct super_block *sb);
 #endif /* HAVE_SERVER_SUPPORT */
 int server_name2fsname(const char *svname, char *fsname, const char **endptr);
 void obdname2fsname(const char *tgt, char *fsname, size_t fslen);
index cfa40d3..d2f4fe5 100644 (file)
@@ -500,7 +500,7 @@ out_free:
 }
 EXPORT_SYMBOL(lustre_start_mgc);
 
-static int lustre_stop_mgc(struct super_block *sb)
+int lustre_stop_mgc(struct super_block *sb)
 {
        struct lustre_sb_info *lsi = s2lsi(sb);
        struct obd_device *obd;
@@ -568,6 +568,7 @@ out:
        mutex_unlock(&mgc_start_lock);
        RETURN(rc);
 }
+EXPORT_SYMBOL(lustre_stop_mgc);
 
 /***************** lustre superblock **************/
 
index 7e86174..442e289 100644 (file)
@@ -1674,6 +1674,7 @@ static void server_put_super(struct super_block *sb)
        /* If they wanted the mgs to stop separately from the mdt, they
         * should have put it on a different device.
         */
+       lustre_stop_mgc(sb);
        if (IS_MGS(lsi)) {
                /* if MDS start with --nomgs, don't stop MGS then */
                if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS))
@@ -1685,8 +1686,8 @@ static void server_put_super(struct super_block *sb)
                        CERROR("%s: failed to stop lwp!\n", tmpname);
        }
 
-       /* Clean the mgc and sb */
-       lustre_common_put_super(sb);
+       /* Drop a ref to the mounted disk */
+       lustre_put_lsi(sb);
 
        /* wait till all in-progress cleanups are done
         * specifically we're interested in ofd cleanup