/*********** mount lookup *********/
DECLARE_MUTEX(lustre_mount_info_lock);
-struct list_head server_mount_info_list = LIST_HEAD_INIT(server_mount_info_list);
+static CFS_LIST_HEAD(server_mount_info_list);
static struct lustre_mount_info *server_find_mount(const char *name)
{
sizeof(recov_bk), &recov_bk, NULL);
if (rc)
/* nonfatal */
- CERROR("can't set %s %d\n", KEY_INIT_RECOV_BACKUP, rc);
+ CWARN("can't set %s %d\n", KEY_INIT_RECOV_BACKUP, rc);
/* We connect to the MGS at setup, and don't disconnect until cleanup */
ocd.ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_FID;
ocd.ocd_version = LUSTRE_VERSION_CODE;
- rc = obd_connect(NULL, &mgc_conn, obd, &(obd->obd_uuid), &ocd);
+ rc = obd_connect(NULL, &mgc_conn, obd, &(obd->obd_uuid), &ocd, NULL);
if (rc) {
CERROR("connect failed %d\n", rc);
GOTO(out, rc);
obd = lsi->lsi_mgc;
if (!obd)
RETURN(-ENOENT);
-
lsi->lsi_mgc = NULL;
+
mutex_down(&mgc_start_lock);
if (!atomic_dec_and_test(&obd->u.cli.cl_mgc_refcount)) {
/* This is not fatal, every client that stops
rc = obd_set_info_async(mgc->u.cli.cl_mgc_mgsexp,
strlen("register_target"), "register_target",
sizeof(*mti), mti, NULL);
- if (rc) {
- CERROR("registration with the MGS failed (%d)\n", rc);
+ if (rc)
GOTO(out, rc);
- }
/* Always update our flags */
ldd->ldd_flags = mti->mti_flags & ~LDD_F_REWRITE_LDD;
lsi->lsi_ldd->ldd_svname);
GOTO(out_mgc, rc);
}
+ /* non-fatal error of registeration with MGS */
+ if (rc)
+ CDEBUG(D_MOUNT, "Cannot register with MGS: %d\n", rc);
/* Let the target look up the mount using the target's name
(we can't pass the sb or mnt through class_process_config.) */
CDEBUG(D_MOUNT, "server put_super %s\n", tmpname);
/* Stop the target */
- if (IS_MDT(lsi->lsi_ldd) || IS_OST(lsi->lsi_ldd)) {
+ if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOSVC) &&
+ (IS_MDT(lsi->lsi_ldd) || IS_OST(lsi->lsi_ldd))) {
struct lustre_profile *lprof = NULL;
/* tell the mgc to drop the config log */
/* stop the mgc before the mgs so the connection gets cleaned
up */
lustre_stop_mgc(sb);
- server_stop_mgs(sb);
+ /* if MDS start with --nomgs, don't stop MGS then */
+ if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS))
+ server_stop_mgs(sb);
}
/* Clean the mgc and sb */
}
/* start MGS before MGC */
- if (IS_MGS(lsi->lsi_ldd)) {
+ if (IS_MGS(lsi->lsi_ldd) && !(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOMGS)) {
rc = server_start_mgs(sb);
if (rc)
GOTO(out_mnt, rc);
} else if (strncmp(s1, "nosvc", 5) == 0) {
lmd->lmd_flags |= LMD_FLG_NOSVC;
clear++;
+ } else if (strncmp(s1, "nomgs", 5) == 0) {
+ lmd->lmd_flags |= LMD_FLG_NOMGS;
+ clear++;
/* ost exclusion list */
} else if (strncmp(s1, "exclude=", 8) == 0) {
rc = lmd_make_exclusion(lmd, s1 + 7);