From: Li Xi Date: Wed, 15 Oct 2014 15:02:10 +0000 (+0800) Subject: LU-5744 obdclass: fix problem of muitple MGTs on same node X-Git-Tag: 2.7.53~13 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F12301%2F2;p=fs%2Flustre-release.git LU-5744 obdclass: fix problem of muitple MGTs on same node 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 Change-Id: Ibebf59be3d41849d02801a4ac29fca31dc06c408 Reviewed-on: http://review.whamcloud.com/12301 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/obd_mount_server.c b/lustre/obdclass/obd_mount_server.c index 96681a0..d89be15 100644 --- a/lustre/obdclass/obd_mount_server.c +++ b/lustre/obdclass/obd_mount_server.c @@ -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 */