lsi->lsi_ldd->ldd_svname, lsi->lsi_ldd->ldd_fsname,
lsi->lsi_lmd->lmd_dev);
- /* append ldd nids to lmd nids */
+ /* append on-disk MGS nids to mount-line MGS nids */
for (i = 0; (i < lsi->lsi_ldd->ldd_mgsnid_count) &&
(lsi->lsi_lmd->lmd_mgsnid_count < MTI_NIDS_MAX); i++) {
lsi->lsi_lmd->lmd_mgsnid[lsi->lsi_lmd->lmd_mgsnid_count++] =
CERROR("ignoring Failed MGS start!!\n");
//GOTO(out_mnt, rc);
} else {
+ /* add local nids (including LO) to MGS nids */
+ lnet_process_id_t id;
+ int j = lsi->lsi_lmd->lmd_mgsnid_count;
+ i = 0;
+ while ((rc = LNetGetId(i++, &id)) != -ENOENT) {
+ if (j >= MTI_NIDS_MAX)
+ break;
+ lsi->lsi_lmd->lmd_mgsnid[j++] = id.nid;
+ }
+ lsi->lsi_lmd->lmd_mgsnid_count = j;
+
mgs_service++;
}
}
if (rc)
GOTO(out_mnt, rc);
- /*Only start MGS/MGC on servers, no other services, even not
- *actually mount the filesystem. */
-
/* Set up all obd devices for service */
if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOSVC) &&
(IS_OST(lsi->lsi_ldd) || IS_MDT(lsi->lsi_ldd))) {
}
}
+#if 0
static int lnet_setup = 0;
static int lnet_start()
{
if (--lnet_setup == 0)
jt_ptl_network(2, cmd);
}
-
+#endif
/*============ disk dev functions ===================*/
case 'f': {
int i = 0;
char *s1 = optarg, *s2;
- if (IS_MGS(&mop->mo_ldd)) {
- badopt(long_opt[longidx].name,
- "non-MGMT MDT,OST");
- return 1;
- }
while ((s2 = strsep(&s1, ","))) {
mop->mo_ldd.ldd_failnid[i++] =
libcfs_str2nid(s2);
mop.mo_ldd.ldd_flags |= LDD_F_SV_TYPE_MGS;
}
+#if 0
if (IS_MGS(&mop.mo_ldd) && (mop.mo_ldd.ldd_mgsnid_count == 0)) {
int i;
__u64 *nids;
}
}
- if (mop.mo_ldd.ldd_mgsnid_count == 0) {
+ if (IS_MGS(&mop.mo_ldd) && mop.mo_ldd.ldd_failnid_count) {
+ /* Add failover nids to mgsnids if we start an MGS
+ (MDT must have all possible MGS nids for failover.) */
+ int i = 0, j = mop.mo_ldd.ldd_mgsnid_count;
+ while (i < mop.mo_ldd.ldd_failnid_count) {
+ if (j >= MTI_NIDS_MAX)
+ break;
+ mop.mo_ldd.ldd_mgsnid[j++] =
+ mop.mo_ldd.ldd_failnid[i++];
+ }
+ mop.mo_ldd.ldd_mgsnid_count = j;
+ }
+#endif
+
+ if (!IS_MGS(&mop.mo_ldd) && (mop.mo_ldd.ldd_mgsnid_count == 0)) {
fatal();
fprintf(stderr, "Must specify either --mgs or --mgsnid\n");
usage(stderr);
out:
loop_cleanup(&mop);
- lnet_stop();
-
return ret;
}