.TP
.BI \--failnode= nid,...
Set the NID(s) of a failover partner. This option can be repeated as desired.
+Cannot be used with --servicenode.
+.TP
+.BI \--servicenode= nid,....
+Set the NID(s) of all service partner. This option treats all nodes as equal
+service nodes. Cannot be used with --failnode.
.TP
.BI \--fsname= filesystem_name
The Lustre filesystem this service will be part of. The maximum
#define LDD_F_WRITECONF 0x0100 /* regenerate all logs for this fs */
#define LDD_F_UPGRADE14 0x0200 /* COMPAT_14 */
#define LDD_F_PARAM 0x0400 /* process as lctl conf_param */
+#define LDD_F_NO_PRIMNODE 0x1000 /* all nodes are specified as servicenodes */
enum ldd_mount_type {
LDD_MT_EXT3 = 0,
__u32 ldd_config_ver; /* config rewrite count - not used */
__u32 ldd_flags; /* LDD_SV_TYPE */
- __u32 ldd_svindex; /* server index (0001), must match
+ __u32 ldd_svindex; /* server index (0001), must match
svname */
__u32 ldd_mount_type; /* target fs type LDD_MT_* */
char ldd_fsname[64]; /* filesystem this server is part of */
{
if (flags & (LDD_F_SV_TYPE_MDT | LDD_F_SV_TYPE_OST)) {
sprintf(name, "%.8s-%s%04x", fs,
- (flags & LDD_F_SV_TYPE_MDT) ? "MDT" : "OST",
+ (flags & LDD_F_SV_TYPE_MDT) ? "MDT" : "OST",
index);
} else if (flags & LDD_F_SV_TYPE_MGS) {
sprintf(name, "MGS");
/****************** mount command *********************/
-/* The lmd is only used internally by Lustre; mount simply passes
+/* The lmd is only used internally by Lustre; mount simply passes
everything as string options */
#define LMD_MAGIC 0xbdacbd03
int lmd_recovery_time_hard;
char *lmd_dev; /* device name */
char *lmd_profile; /* client only */
- char *lmd_opts; /* lustre mount options (as opposed to
+ char *lmd_opts; /* lustre mount options (as opposed to
_device_ mount options) */
__u32 *lmd_exclude; /* array of OSTs to ignore */
};
existing MGS services */
#define LMD_FLG_WRITECONF 0x0040 /* Rewrite config log */
-#define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT)
+#define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT)
/****************** last_rcvd file *********************/
lcd->lcd_uuid[length - 1] = '\0';
LCONSOLE_ERROR("the client UUID (%s) on %s for exports"
- "stored in last_rcvd(index = %d) is bad!\n",
+ "stored in last_rcvd(index = %d) is bad!\n",
lcd->lcd_uuid, obd_name, index);
}
}
int lustre_common_put_super(struct super_block *sb);
-int lustre_process_log(struct super_block *sb, char *logname,
+int lustre_process_log(struct super_block *sb, char *logname,
struct config_llog_instance *cfg);
-int lustre_end_log(struct super_block *sb, char *logname,
+int lustre_end_log(struct super_block *sb, char *logname,
struct config_llog_instance *cfg);
struct lustre_mount_info *server_find_mount_locked(char *name);
struct lustre_mount_info *server_get_mount(char *name);
/* Nothing wrong, or fatal error */
GOTO(out_nolock, rc);
} else {
- if ((rc = mgs_check_failover_reg(mti)))
+ if (!(mti->mti_flags & LDD_F_NO_PRIMNODE)
+ && (rc = mgs_check_failover_reg(mti)))
GOTO(out_nolock, rc);
}
char *ptr = mti->mti_params;
lnet_nid_t nid;
int rc = 0;
-
/*
#03 L add_uuid nid=uml1@tcp(0x20000c0a80201) nal=90 0: 1:uml1_UUID
#04 L add_uuid nid=1@elan(0x1000000000001) nal=90 0: 1:uml1_UUID
struct lustre_sb_info *lsi = s2lsi(sb);
struct lustre_disk_data *ldd = lsi->lsi_ldd;
lnet_process_id_t id;
+ lnet_nid_t nid;
+ char *ptr;
int i = 0;
ENTRY;
while (LNetGetId(i++, &id) != -ENOENT) {
if (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND)
continue;
+ if ((ldd->ldd_flags & LDD_F_NO_PRIMNODE) != 0) {
+ /* server use --servicenode param, only allow specified
+ * nids be registered */
+ ptr = ldd->ldd_params;
+ while (class_find_param(ptr, PARAM_FAILNODE, &ptr) ==0){
+ while (class_parse_nid(ptr, &nid, &ptr) == 0) {
+ if (nid == id.nid)
+ goto allowed;
+ }
+ }
+ continue;
+ }
+allowed:
mti->mti_nids[mti->mti_nid_count] = id.nid;
mti->mti_nid_count++;
if (mti->mti_nid_count >= MTI_NIDS_MAX) {
}
run_test 56 "check big indexes"
-test_57() { # bug 22656
+test_57a() { # bug 22656
local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
writeconf
do_facet ost1 "$TUNEFS --failnode=$NID `ostdevname 1`" || error "tunefs failed"
start_mgsmds
- stop_mds
start_ost && error "OST registration from failnode should fail"
reformat
}
-run_test 57 "initial registration from failnode should fail (should return errs)"
+run_test 57a "initial registration from failnode should fail (should return errs)"
+
+test_57b() {
+ local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
+ writeconf
+ do_facet ost1 "$TUNEFS --servicenode=$NID `ostdevname 1`" || error "tunefs failed"
+ start_mgsmds
+ start_ost || error "OST registration from servicenode should not fail"
+ reformat
+}
+run_test 57b "initial registration from servicenode should not fail"
test_58() { # bug 22658
[ "$FSTYPE" != "ldiskfs" ] && skip "not supported for $FSTYPE" && return
"\t\t\trequired for all targets other than the mgs node\n"
"\t\t--fsname=<filesystem_name> : default is 'lustre'\n"
"\t\t--failnode=<nid>[,<...>] : NID(s) of a failover partner\n"
+ "\t\t\tcannot be used with --servicenode\n"
+ "\t\t--servicenode=<nid>[,<...>] : NID(s) of all service partners\n"
+ "\t\t\ttreat all nodes as equal service node, cannot be used with --failnode\n"
"\t\t--param <key>=<value> : set a permanent parameter\n"
"\t\t\te.g. --param sys.timeout=40\n"
"\t\t\t --param lov.stripesize=2M\n"
printf("Lustre FS: %s\n", ldd->ldd_fsname);
printf("Mount type: %s\n", MT_STR(ldd));
printf("Flags: %#x\n", ldd->ldd_flags);
- printf(" (%s%s%s%s%s%s%s%s)\n",
+ printf(" (%s%s%s%s%s%s%s%s%s)\n",
IS_MDT(ldd) ? "MDT ":"",
IS_OST(ldd) ? "OST ":"",
IS_MGS(ldd) ? "MGS ":"",
ldd->ldd_flags & LDD_F_VIRGIN ? "first_time ":"",
ldd->ldd_flags & LDD_F_UPDATE ? "update ":"",
ldd->ldd_flags & LDD_F_WRITECONF ? "writeconf ":"",
+ ldd->ldd_flags & LDD_F_NO_PRIMNODE? "no_primnode ":"",
ldd->ldd_flags & LDD_F_UPGRADE14 ? "upgrade1.4 ":"");
printf("Persistent mount opts: %s\n", ldd->ldd_mount_opts);
printf("Parameters:%s\n", ldd->ldd_params);
{"print", 0, 0, 'n'},
{"quiet", 0, 0, 'q'},
{"reformat", 0, 0, 'r'},
+ {"servicenode", 1, 0, 's'},
{"verbose", 0, 0, 'v'},
{"writeconf", 0, 0, 'w'},
{0, 0, 0, 0}
};
- char *optstring = "b:c:C:d:ef:Ghi:k:L:m:MnNo:Op:Pqru:vw";
+ char *optstring = "b:c:C:d:ef:Ghi:k:L:m:MnNo:Op:Pqrsu:vw";
int opt;
int rc, longidx;
int upcall = 0;
const size_t prefix_len = sizeof(PARAM_MDT_UPCALL) - 1;
+ int failnode_set = 0, servicenode_set = 0;
while ((opt = getopt_long(argc, argv, optstring, long_opt, &longidx)) !=
EOF) {
/* Must update the mgs logs */
mop->mo_ldd.ldd_flags |= LDD_F_UPDATE;
break;
- case 'f': {
- char *nids = convert_hostnames(optarg);
+ case 'f':
+ case 's': {
+ char *nids;
+
+ if ((opt == 'f' && servicenode_set)
+ || (opt == 's' && failnode_set)) {
+ fprintf(stderr, "%s: %s cannot use with --%s\n",
+ progname, long_opt[longidx].name,
+ opt == 'f' ? "servicenode" : "failnode");
+ return 1;
+ }
+
+ nids = convert_hostnames(optarg);
if (!nids)
return 1;
rc = add_param(mop->mo_ldd.ldd_params, PARAM_FAILNODE,
return rc;
/* Must update the mgs logs */
mop->mo_ldd.ldd_flags |= LDD_F_UPDATE;
+ if (opt == 'f') {
+ failnode_set = 1;
+ } else {
+ mop->mo_ldd.ldd_flags |= LDD_F_NO_PRIMNODE;
+ servicenode_set = 1;
+ }
failover = 1;
break;
}