}
#ifndef MTI_NIDS_MAX /* match lustre_idl.h */
-#define MTI_NIDS_MAX 10
+#define MTI_NIDS_MAX 64
#endif
#define LDD_INCOMPAT_SUPP 0
svname */
__u16 ldd_mgsnid_count;
__u16 ldd_failnid_count; /* server failover nid count */
- lnet_nid_t ldd_mgsnid[MTI_NIDS_MAX]; /* mgmt nid list; lmd can
+ lnet_nid_t ldd_mgsnid[MTI_NIDS_MAX]; /* mgs nid list; lmd can
override */
lnet_nid_t ldd_failnid[MTI_NIDS_MAX]; /* server failover nids */
char ldd_mount_opts[2048]; /* target fs mount opts */
(flags & LDD_F_SV_TYPE_MDT) ? "MDT" : "OST",
index);
} else if (flags & LDD_F_SV_TYPE_MGS) {
- sprintf(name, "MGMT");
+ sprintf(name, "MGS");
} else {
CERROR("unknown server type %#x\n", flags);
return 1;
#define MTI_NAME_MAXLEN 64
#define MTI_UUID_MAXLEN MTI_NAME_MAXLEN + 5
-#define MTI_NIDS_MAX 10 /* match lustre_disk.h */
+/* each host can have multiple nids, and multiple failover hosts, and I don't
+ want to run out of room... */
+#define MTI_NIDS_MAX 64 /* match lustre_disk.h */
struct mgs_target_info {
char mti_fsname[MTI_NAME_MAXLEN];
void *data)
{
OBD_CHECK_DEV(obd);
- if (!obd->obd_set_up) {
- CERROR("obd %s not set up\n", obd->obd_name);
- return -EINVAL;
+
+ /* the check for async_recov is a complete hack - I'm hereby
+ overloading the meaning to also mean "this was called from
+ mds_postsetup". I know that my mds is able to handle notifies
+ by this point, and it needs to get them to execute mds_postrecov. */
+ if (!obd->obd_set_up && !obd->obd_async_recov) {
+ CERROR("obd %s not set up, notifying anyhow\n", obd->obd_name);
+ return -EAGAIN;
}
if (!OBP(obd, notify)) {
/* FIXME Does target_finish_recovery really need this to block? */
/* Notify the LOV, which will in turn call mds_notify for each tgt */
+ /* This means that we have to fool obd_notify to think we're obd_set_up
+ during mds_lov_connect. */
obd_notify(obd->u.mds.mds_osc_obd, NULL,
obd->obd_async_recov ? OBD_NOTIFY_SYNC_NONBLOCK :
OBD_NOTIFY_SYNC, NULL);
- //mds_lov_start_synchronize(obd, NULL, NULL, obd->obd_async_recov);
/* quota recovery */
lquota_recovery(quota_interface, obd);
* set_nextid(). The class driver can help us here, because
* it can use the obd_recovering flag to determine when the
* the OBD is full available. */
- if (!obd->obd_recovering)
+ if (!obd->obd_recovering)
rc = mds_postrecov(obd);
RETURN(rc);
ENTRY;
switch (ev) {
+ /* We only handle these: */
case OBD_NOTIFY_ACTIVE:
case OBD_NOTIFY_SYNC:
case OBD_NOTIFY_SYNC_NONBLOCK:
CDEBUG(D_WARNING, "notify %s ev=%d\n", watched->obd_name, ev);
- if (strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME)) {
+ if (strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME) != 0) {
CERROR("unexpected notification of %s %s!\n",
watched->obd_type->typ_name, watched->obd_name);
RETURN(-EINVAL);
}
}
-#if 0
-static int lnet_setup = 0;
-static int lnet_start()
-{
- ptl_initialize(0, NULL);
- if (access("/proc/sys/lnet", X_OK) != 0) {
- fprintf(stderr, "%s: The LNET module must be loaded to "
- "determine local NIDs\n", progname);
- return 1;
- }
- if (jt_ptl_get_nids(NULL) == -ENETDOWN) {
- char *cmd[]={"network", "up"};
- jt_ptl_network(2, cmd);
- lnet_setup++;
- }
- return 0;
-}
-
-static void lnet_stop()
-{
- char *cmd[]={"network", "down"};
- if (--lnet_setup == 0)
- jt_ptl_network(2, cmd);
-}
-#endif
/*============ disk dev functions ===================*/
char *s1 = optarg, *s2;
if (IS_MGS(&mop->mo_ldd)) {
badopt(long_opt[longidx].name,
- "non-MGMT MDT,OST");
+ "non-MGS MDT,OST");
return 1;
}
while ((s2 = strsep(&s1, ","))) {
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;
-
- vprint("No mgs nids specified, using all local nids\n");
- ret = lnet_start();
- if (ret)
- goto out;
- i = jt_ptl_get_nids(&nids);
- if (i < 0) {
- fprintf(stderr, "%s: Can't find local nids "
- "(is the lnet module loaded?)\n", progname);
- } else {
- if (i > 0) {
- if (i > MTI_NIDS_MAX)
- i = MTI_NIDS_MAX;
- vprint("Adding %d local nids for MGS\n", i);
- memcpy(mop.mo_ldd.ldd_mgsnid, nids,
- sizeof(mop.mo_ldd.ldd_mgsnid));
- free(nids);
- }
- mop.mo_ldd.ldd_mgsnid_count = i;
- }
- }
-
- 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");