From 7523aeb310093bbb7e063a9390304e67310da4f1 Mon Sep 17 00:00:00 2001 From: Li Xi Date: Wed, 15 Oct 2014 23:02:10 +0800 Subject: [PATCH] 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 --- lustre/obdclass/obd_mount_server.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 */ -- 1.8.3.1