Whamcloud - gitweb
Branch b1_4_mountconf
authornathan <nathan>
Tue, 13 Dec 2005 01:28:30 +0000 (01:28 +0000)
committernathan <nathan>
Tue, 13 Dec 2005 01:28:30 +0000 (01:28 +0000)
b=8007
can now mount mgmt, ost, and mdt (in that order)successfully.  Haven't
tried client yet...

lustre/include/linux/obd_class.h
lustre/lov/lov_obd.c
lustre/mds/handler.c
lustre/mgs/mgs_llog.c
lustre/obdclass/class_obd.c
lustre/obdclass/genops.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c

index 3e44288..9064072 100644 (file)
@@ -65,6 +65,7 @@ int class_name2dev(char *name);
 struct obd_device *class_name2obd(char *name);
 int class_uuid2dev(struct obd_uuid *uuid);
 struct obd_device *class_uuid2obd(struct obd_uuid *uuid);
+void class_obd_list(void);
 struct obd_device * class_find_client_obd(struct obd_uuid *tgt_uuid,
                                           char * typ_name,
                                           struct obd_uuid *grp_uuid);
index 39ee540..687e597 100644 (file)
@@ -109,6 +109,8 @@ static int lov_connect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
         int rc;
         ENTRY;
 
+        class_obd_list();
+
         tgt_obd = class_find_client_obd(tgt_uuid, LUSTRE_OSC_NAME,
                                         &obd->obd_uuid);
 
index 2cea5ea..1b54741 100644 (file)
@@ -1632,6 +1632,8 @@ static int mds_lov_clean(struct obd_device *obd)
         /* There better be a lov */
         if (!osc)
                 RETURN(0);
+        if (IS_ERR(osc))
+                RETURN(PTR_ERR(osc));
 
         obd_register_observer(osc, NULL);
 
index 44829d9..d3e597c 100644 (file)
@@ -675,7 +675,7 @@ static int mgs_write_log_osc(struct obd_device *obd,
                              char *logname, char *lovname, char *ostuuid)
 {
         struct llog_handle *llh = NULL;
-        char *nodeuuid, *oscname, *oscuuid;
+        char *nodeuuid, *oscname, *oscuuid, *lovuuid;
         char index[5];
         int rc;
 
@@ -688,6 +688,7 @@ static int mgs_write_log_osc(struct obd_device *obd,
         name_create(libcfs_nid2str(mti->mti_nid), "_UUID", &nodeuuid);
         name_create(mti->mti_svname, "-osc", &oscname);
         name_create(oscname, "_UUID", &oscuuid);
+        name_create(lovname, "_UUID", &lovuuid);
 
         /*
         #03 L add_uuid nid=uml1@tcp(0x20000c0a80201) 0:  1:uml1_UUID
@@ -699,13 +700,14 @@ static int mgs_write_log_osc(struct obd_device *obd,
         */
         rc = record_start_log(obd, &llh, logname);
         rc = record_add_uuid(obd, llh, mti->mti_nid, nodeuuid);
-        rc = record_attach(obd, llh, oscname, LUSTRE_OSC_NAME, oscuuid);
+        rc = record_attach(obd, llh, oscname, LUSTRE_OSC_NAME, lovuuid);
         rc = record_setup(obd, llh, oscname, ostuuid, nodeuuid, 0, 0);
         /* FIXME add uuid, add_conn for failover ost's */
         snprintf(index, sizeof(index), "%d", mti->mti_stripe_index);
         rc = record_lov_add(obd,llh, lovname, ostuuid, index,"1"/*generation*/);
         rc = record_end_log(obd, &llh);
         
+        name_destroy(lovuuid);
         name_destroy(oscuuid);
         name_destroy(oscname);
         name_destroy(nodeuuid);
index b68223d..6dd920d 100644 (file)
@@ -400,6 +400,7 @@ EXPORT_SYMBOL(class_name2dev);
 EXPORT_SYMBOL(class_name2obd);
 EXPORT_SYMBOL(class_uuid2dev);
 EXPORT_SYMBOL(class_uuid2obd);
+EXPORT_SYMBOL(class_obd_list);
 EXPORT_SYMBOL(class_find_client_obd);
 EXPORT_SYMBOL(class_find_client_notype);
 EXPORT_SYMBOL(class_devices_in_group);
index 1d2e02c..616a02f 100644 (file)
@@ -292,6 +292,33 @@ struct obd_device *class_uuid2obd(struct obd_uuid *uuid)
         return &obd_dev[dev];
 }
 
+void class_obd_list(void)
+{
+        char *status;
+        int i;
+
+        spin_lock(&obd_dev_lock);
+        for (i = 0; i < MAX_OBD_DEVICES; i++) {
+                struct obd_device *obd = &obd_dev[i];
+                if (obd->obd_type == NULL)
+                        continue;
+                if (obd->obd_stopping)
+                        status = "ST";
+                else if (obd->obd_set_up)
+                        status = "UP";
+                else if (obd->obd_attached)
+                        status = "AT";
+                else
+                        status = "--";
+                CDEBUG(D_WARNING, "%3d %s %s %s %s %d\n",
+                       i, status, obd->obd_type->typ_name,
+                       obd->obd_name, obd->obd_uuid.uuid,
+                       atomic_read(&obd->obd_refcount));
+        }
+        spin_unlock(&obd_dev_lock);
+        return;
+}
+
 /* Search for a client OBD connected to tgt_uuid.  If grp_uuid is
    specified, then only the client with that uuid is returned,
    otherwise any client connected to the tgt is returned. */
index 6d39e7c..e862e43 100644 (file)
@@ -747,7 +747,10 @@ static int class_config_llog_handler(struct llog_handle * handle,
                                lcfg->lcfg_command, inst_name);
                 }
 
-                if (cfg && lcfg->lcfg_command == LCFG_ATTACH) {
+                /* we override the llog's uuid for clients, to insure they
+                are unique */
+                if (cfg && cfg->cfg_instance && 
+                    lcfg->lcfg_command == LCFG_ATTACH) {
                         lustre_cfg_bufs_set_string(&bufs, 2, cfg->cfg_uuid.uuid);
                 }
 
index eb63b01..d71d514 100644 (file)
@@ -428,6 +428,9 @@ int lustre_get_process_log(struct super_block *sb, char *logname,
                 }
         }
 
+        CDEBUG(D_MOUNT, "after lustre_get_process_log %s\n", logname);
+        class_obd_list();
+
 out:
         return (rc);
 }
@@ -874,7 +877,6 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt)
 
         /* The MGC starts targets using the svname llog */
         cfg.cfg_instance = NULL;
-        cfg.cfg_uuid = lsi->lsi_mgc->obd_uuid;
         rc = lustre_get_process_log(sb, lsi->lsi_ldd->ldd_svname, &cfg);
         if (rc) {
                 CERROR("failed to start server %s: %d\n",