Whamcloud - gitweb
LU-5744 obdclass: fix problem of muitple MGTs on same node 01/12301/2
authorLi Xi <lixi@ddn.com>
Wed, 15 Oct 2014 15:02:10 +0000 (23:02 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 1 May 2015 03:23:35 +0000 (03:23 +0000)
When a MGT is mounted on a node which already has an running MGT
it will fail as expected since only one MGS can run on a node.
However, the MGS will be stopped by mistake during this process.
This patch fixes the problem.

Signed-off-by: Li Xi <pkuelelixi@gmail.com>
Change-Id: Ibebf59be3d41849d02801a4ac29fca31dc06c408
Reviewed-on: http://review.whamcloud.com/12301
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/obd_mount_server.c

index 96681a0..d89be15 100644 (file)
@@ -264,8 +264,14 @@ static int server_stop_mgs(struct super_block *sb)
 {
        struct obd_device *obd;
        int rc;
+       struct lustre_mount_info *lmi;
        ENTRY;
 
+       /* Do not stop MGS if this device is not the running MGT */
+       lmi = server_find_mount(LUSTRE_MGS_OBDNAME);
+       if (lmi != NULL && lmi->lmi_sb != sb)
+               RETURN(0);
+
        CDEBUG(D_MOUNT, "Stop MGS service %s\n", LUSTRE_MGS_OBDNAME);
 
        /* There better be only one MGS */