/* Either an MDT or an OST or neither */
/* if this was an MDT, and there are no more MDT's, clean up the MDS */
if ((lsiflags & LDD_F_SV_TYPE_MDT) &&
- (obd = class_name2obd(LUSTRE_MDS_OBDNAME))) {
- /*FIXME pre-rename, should eventually be LUSTRE_MDT_NAME*/
- type = class_search_type(LUSTRE_MDS_NAME);
- }
- /* if this was an OST, and there are no more OST's, clean up the OSS */
+ (obd = class_name2obd(LUSTRE_MDS_OBDNAME))) {
+ type = class_search_type(LUSTRE_MDT_NAME);
+ }
+ /* if this was an OST, and there are no more OST's, clean up the OSS */
if ((lsiflags & LDD_F_SV_TYPE_OST) &&
(obd = class_name2obd(LUSTRE_OSS_OBDNAME))) {
type = class_search_type(LUSTRE_OST_NAME);
CDEBUG(D_MOUNT, "starting target %s\n", lsi->lsi_svname);
-#if 0
- /* If we're an MDT, make sure the global MDS is running */
- if (lsi->lsi_ldd->ldd_flags & LDD_F_SV_TYPE_MDT) {
- /* make sure the MDS is started */
+ if (IS_MDT(lsi)) {
+ /* make sure the MDS is started */
mutex_lock(&server_start_lock);
- obd = class_name2obd(LUSTRE_MDS_OBDNAME);
- if (!obd) {
- rc = lustre_start_simple(LUSTRE_MDS_OBDNAME,
- /* FIXME pre-rename, should eventually be LUSTRE_MDS_NAME */
- LUSTRE_MDT_NAME,
- LUSTRE_MDS_OBDNAME"_uuid",
- 0, 0);
- if (rc) {
+ obd = class_name2obd(LUSTRE_MDS_OBDNAME);
+ if (!obd) {
+ rc = lustre_start_simple(LUSTRE_MDS_OBDNAME,
+ LUSTRE_MDS_NAME,
+ LUSTRE_MDS_OBDNAME"_uuid",
+ 0, 0, 0, 0);
+ if (rc) {
mutex_unlock(&server_start_lock);
- CERROR("failed to start MDS: %d\n", rc);
- RETURN(rc);
- }
- }
+ CERROR("failed to start MDS: %d\n", rc);
+ RETURN(rc);
+ }
+ }
mutex_unlock(&server_start_lock);
- }
-#endif
+ }
/* If we're an OST, make sure the global OSS is running */
if (IS_OST(lsi)) {
if (lsi->lsi_srv_mnt) {
rc = server_mgc_set_fs(lsi->lsi_mgc, sb);
if (rc)
- RETURN(rc);
+ GOTO(out_stop_service, rc);
}
/* Register with MGS */
if (lsi->lsi_srv_mnt)
server_mgc_clear_fs(lsi->lsi_mgc);
+out_stop_service:
+ if (rc != 0)
+ server_stop_servers(lsi->lsi_flags);
+
RETURN(rc);
}
obd = class_name2obd(lsi->lsi_svname);
if (obd) {
CDEBUG(D_MOUNT, "stopping %s\n", obd->obd_name);
- if (lsi->lsi_flags & LSI_UMOUNT_FAILOVER)
+ if (lsiflags & LSI_UMOUNT_FAILOVER)
obd->obd_fail = 1;
/* We can't seem to give an error return code
* to .put_super, so we better make sure we clean up! */