lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Nov 2013 00:42:57 +0800
From:	Peng Tao <bergwolf@...il.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-kernel@...r.kernel.org, Bobi Jam <bobijam.xu@...el.com>,
	Peng Tao <bergwolf@...il.com>,
	Andreas Dilger <andreas.dilger@...el.com>
Subject: [PATCH 10/26] staging/lustre/ldlm: MDT mount fails on MDS w/o MGS on it

From: Bobi Jam <bobijam.xu@...el.com>

If we specify multiple --mgsnode for a MDT, when we start MDS upon
it while MGS is no the other node, the MGC import connection will
always select the local nid (which is one of the candidate mgsnode)
since it think its the closest connection.

This patch treats further --mgsnode nids as failover nids, so that
multiple import connections are added for the MGC import.

Lustre-change: http://review.whamcloud.com/7509
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3829
Signed-off-by: Bobi Jam <bobijam.xu@...el.com>
Reviewed-by: Liang Zhen <liang.zhen@...el.com>
Reviewed-by: Lai Siyao <lai.siyao@...el.com>
Reviewed-by: Oleg Drokin <oleg.drokin@...el.com>
Signed-off-by: Peng Tao <bergwolf@...il.com>
Signed-off-by: Andreas Dilger <andreas.dilger@...el.com>
---
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |   38 +++++++++++++-------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
index a69a630..74e170f 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
@@ -332,12 +332,13 @@ int lustre_start_mgc(struct super_block *sb)
 	sprintf(niduuid, "%s_%x", mgcname, i);
 	if (IS_SERVER(lsi)) {
 		ptr = lsi->lsi_lmd->lmd_mgs;
+		CDEBUG(D_MOUNT, "mgs nids %s.\n", ptr);
 		if (IS_MGS(lsi)) {
 			/* Use local nids (including LO) */
 			lnet_process_id_t id;
 			while ((rc = LNetGetId(i++, &id)) != -ENOENT) {
-				rc = do_lcfg(mgcname, id.nid,
-					     LCFG_ADD_UUID, niduuid, 0,0,0);
+				rc = do_lcfg(mgcname, id.nid, LCFG_ADD_UUID,
+					     niduuid, 0, 0, 0);
 			}
 		} else {
 			/* Use mgsnode= nids */
@@ -349,19 +350,30 @@ int lustre_start_mgc(struct super_block *sb)
 				CERROR("No MGS nids given.\n");
 				GOTO(out_free, rc = -EINVAL);
 			}
+			/*
+			 * LU-3829.
+			 * Here we only take the first mgsnid as its primary
+			 * serving mgs node, the rest mgsnid will be taken as
+			 * failover mgs node, otherwise they would be takens
+			 * as multiple nids of a single mgs node.
+			 */
 			while (class_parse_nid(ptr, &nid, &ptr) == 0) {
-				rc = do_lcfg(mgcname, nid,
-					     LCFG_ADD_UUID, niduuid, 0,0,0);
-				i++;
+				rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
+					     niduuid, 0, 0, 0);
+				if (rc == 0) {
+					i = 1;
+					break;
+				}
 			}
 		}
 	} else { /* client */
 		/* Use nids from mount line: uml1,1@...n:uml2,2@...n:/lustre */
 		ptr = lsi->lsi_lmd->lmd_dev;
 		while (class_parse_nid(ptr, &nid, &ptr) == 0) {
-			rc = do_lcfg(mgcname, nid,
-				     LCFG_ADD_UUID, niduuid, 0,0,0);
-			i++;
+			rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
+				     niduuid, 0, 0, 0);
+			if (rc == 0)
+				++i;
 			/* Stop at the first failover nid */
 			if (*ptr == ':')
 				break;
@@ -394,16 +406,18 @@ int lustre_start_mgc(struct super_block *sb)
 		sprintf(niduuid, "%s_%x", mgcname, i);
 		j = 0;
 		while (class_parse_nid_quiet(ptr, &nid, &ptr) == 0) {
-			j++;
-			rc = do_lcfg(mgcname, nid,
-				     LCFG_ADD_UUID, niduuid, 0,0,0);
+			rc = do_lcfg(mgcname, nid, LCFG_ADD_UUID,
+				     niduuid, 0, 0, 0);
+			if (rc == 0)
+				++j;
 			if (*ptr == ':')
 				break;
 		}
 		if (j > 0) {
 			rc = do_lcfg(mgcname, 0, LCFG_ADD_CONN,
 				     niduuid, 0, 0, 0);
-			i++;
+			if (rc == 0)
+				++i;
 		} else {
 			/* at ":/fsname" */
 			break;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ