Whamcloud - gitweb
Branch b1_4_mountconf
authornathan <nathan>
Thu, 12 Jan 2006 00:58:59 +0000 (00:58 +0000)
committernathan <nathan>
Thu, 12 Jan 2006 00:58:59 +0000 (00:58 +0000)
b=4482
move the mds_conn after the ost addition, like bz9926
identified but not fixed another ost_add problem: can't clearorphans
 on any tgt that mds doesn't know about yet.
fixup mkfs verbiage

lustre/lov/lov_log.c
lustre/lov/lov_obd.c
lustre/mds/mds_lov.c
lustre/obdclass/obd_mount.c
lustre/utils/mkfs_lustre.c
lustre/utils/mount_lustre.c

index 325d4b1..11f8e56 100644 (file)
@@ -101,11 +101,10 @@ static int lov_llog_origin_connect(struct llog_ctxt *ctxt, int count,
         int i, rc = 0;
         ENTRY;
 
+        /* We might have added an osc and not told the mds yet */
         if (count != lov->desc.ld_tgt_count)
                 CERROR("Origin connect mds cnt %d != lov cnt %d\n", count,
                        lov->desc.ld_tgt_count);
-        /* count must match if we're doing all */
-        LASSERT(uuid || (count == lov->desc.ld_tgt_count));
 
         for (i = 0, tgt = lov->tgts; i < count; i++, tgt++) {
                 struct obd_device *child;
index 1adcbff..02be24d 100644 (file)
@@ -886,6 +886,9 @@ static int lov_clear_orphans(struct obd_export *export, struct obdo *src_oa,
                 if (ost_uuid && !obd_uuid_equals(ost_uuid, &lov->tgts[i].uuid))
                         continue;
 
+                // FIXME remove
+                CERROR("Clear orphans for %d:%s\n", i, ost_uuid->uuid);
+
                 memcpy(tmp_oa, src_oa, sizeof(*tmp_oa));
 
                 LASSERT(lov->tgts[i].ltd_exp);
index f7f1250..e987e51 100644 (file)
@@ -138,6 +138,16 @@ int mds_lov_clearorphans(struct mds_obd *mds, struct obd_uuid *ost_uuid)
 
         LASSERT(mds->mds_lov_objids != NULL);
 
+        // FIXME remove all this debug stuff
+        CERROR("Clearorphans, %d targets\n", mds->mds_lov_desc.ld_tgt_count);
+        for (rc = 0; rc < mds->mds_lov_desc.ld_tgt_count; rc++)
+                CDEBUG(D_WARNING, "clearorphans "LPU64" for idx %d\n",
+                       mds->mds_lov_objids[rc], rc);
+        /* FIXME --- can't clearorphans for lov tgts that the mds does not
+           know about yet!  can only clearorphans on 
+           mds->mds_lov_desc.ld_tgt_count (if that - if late tgt joins
+           first, is that okay?) */
+
         /* This create will in fact either create or destroy:  If the OST is
          * missing objects below this ID, they will be created.  If it finds
          * objects above this ID, they will be removed. */
@@ -618,25 +628,25 @@ static int __mds_lov_synchronize(void *data)
         LASSERT(obd != NULL);
 
         /* We can't change the target count in one of these sync
-           threads while another sync thread is doing the clearorphans on
-           all the targets. */
+           threads while another sync thread is doing clearorphans on
+           all the targets. 
+           If we're syncing a particular target, or we're not 
+           changing the target_count, then we don't need the sem */
         if (!watched || (idx != MLSI_NO_INDEX)) {
-                /* if we're syncing a particular target, or we're not 
-                   changing the target_count, then we don't need the sem */
                 down(&mds->mds_lov_sem);
                 have_sem++;
         }
 
-        rc = obd_set_info(mds->mds_osc_exp, strlen(KEY_MDS_CONN),
-                          KEY_MDS_CONN, 0, uuid);
-        if (rc != 0)
-                GOTO(out, rc);
-
         if (idx != MLSI_NO_INDEX) {
                 rc = mds_lov_add_ost(obd, watched, idx);
                 if (rc != 0)
                         GOTO(out, rc);
         }
+        
+        rc = obd_set_info(mds->mds_osc_exp, strlen(KEY_MDS_CONN),
+                          KEY_MDS_CONN, 0, uuid);
+        if (rc != 0)
+                GOTO(out, rc);
 
         rc = llog_connect(llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT),
                           mds->mds_lov_desc.ld_tgt_count,
index df5ca72..8693107 100644 (file)
@@ -256,6 +256,12 @@ static void ldd_print(struct lustre_disk_data *ldd)
                 PRINT_CMD(PRINT_MASK, "mgs nid %d:  %s\n", i, 
                        libcfs_nid2str(ldd->ldd_mgsnid[i]));
         }
+        if (!ldd->ldd_failnid_count)
+                PRINT_CMD(PRINT_MASK, "no failover nids\n");
+        else for (i = 0; i < ldd->ldd_failnid_count; i++) {
+                PRINT_CMD(PRINT_MASK, "failover nid %d:  %s\n", i,
+                          libcfs_nid2str(ldd->ldd_failnid[i]));
+        }
 }
 
 static int ldd_parse(struct lvfs_run_ctxt *mount_ctxt, 
index c9f0f53..9e8abd7 100644 (file)
@@ -63,30 +63,35 @@ static char *ret_file = "/tmp/mkfs.log";
 
 void usage(FILE *out)
 {
-        fprintf(out, "usage: %s [options] <device>\n", progname);
+        fprintf(out, "usage: %s <target types> [options] <device>\n", progname);
 
         fprintf(out, 
                 "\t<device>:block device or file (e.g /dev/sda or /tmp/ost1)\n"
-                "\toptions:\n"
+                "\ttarget types:\n"
                 "\t\t--ost: object storage, mutually exclusive with mdt\n"
                 "\t\t--mdt: metadata storage, mutually exclusive with ost\n"
                 "\t\t--mgmt: configuration management service - one per site\n"
-                "\t\t--mgmtnid=<nid>[,<...>]:nid(s) of a remote mgmt node\n"
-                "\t\t--fsname=<filesystem_name>\n"
+                "\toptions:\n"
+                "\t\t--mgmtnid=<nid>[,<...>] : NID(s) of a remote mgmt node\n"
+                "\t\t\trequired for all targets other than the mgmt node\n"
+                "\t\t--fsname=<filesystem_name> : default is 'lustre'\n"
+#if 0 /* FIXME implement */
                 "\t\t--configdev=<altdevice|file>: store configuration info\n"
                 "\t\t\tfor this device on an alternate device\n"
-                "\t\t--failover=<failover-address>\n"
-                "\t\t--backfstype=<fstype>: backing fs type (ext3, ldiskfs)\n"
-                "\t\t--device-size=#N(KB):device size \n"
-                "\t\t--stripe-count=#N:number of stripe\n"
-                "\t\t--stripe-size=#N(KB):stripe size\n"
-                "\t\t--index=#N:target index\n"
-                "\t\t--mountfsoptions=<opts>: permanent mount options\n"
+#endif
+                "\t\t--failover=<nid>[,<...>] : list of NIDs for the failover\n"
+                "\t\t\tpartners for this target\n" 
+                "\t\t--backfstype=<fstype> : backing fs type (ext3, ldiskfs)\n"
+                "\t\t--device-size=#N(KB) : device size for loop devices\n"
+                "\t\t--stripe-count=#N : default number of stripes\n"
+                "\t\t--stripe-size=#N(KB) : default stripe size\n"
+                "\t\t--index=#N : target index\n"
+                "\t\t--mountfsoptions=<opts> : permanent mount options\n"
 #ifndef TUNEFS
-                "\t\t--mkfsoptions=<opts>: format options\n"
+                "\t\t--mkfsoptions=<opts> : format options\n"
                 "\t\t--reformat: overwrite an existing disk\n"
 #endif
-                "\t\t--timeout=<secs>: system timeout period\n"
+                "\t\t--timeout=<secs> : system timeout period\n"
                 "\t\t--verbose\n"
                 "\t\t--quiet\n");
         return;
@@ -489,7 +494,7 @@ int make_lustre_backfs(struct mkfs_opts *mop)
         
         vprint("formatting backing filesystem %s on %s\n",
                MT_STR(&mop->mo_ldd), dev);
-        vprint("\tservice name  %s\n", mop->mo_ldd.ldd_svname);
+        vprint("\ttarget name  %s\n", mop->mo_ldd.ldd_svname);
         vprint("\t4k blocks     %d\n", block_count);
         vprint("\toptions       %s\n", mop->mo_mkfsopts);
 
@@ -521,7 +526,7 @@ void print_ldd(struct lustre_disk_data *ldd)
 {
         int i = 0;
         printf("\nPermanent disk data:\n");
-        printf("Server:     %s\n", ldd->ldd_svname);
+        printf("Target:     %s\n", ldd->ldd_svname);
         printf("Lustre FS:  %s\n", ldd->ldd_fsname);
         printf("Mount type: %s\n", MT_STR(ldd));
         printf("Flags:      %s%s%s%s\n",
@@ -708,7 +713,7 @@ int main(int argc , char *const argv[])
                 case 'f':
                         /* we must pass this info on when we register with
                            the mgs */
-                        //mop.mo_hostnid.backup = libcfs_str2nid(optarg);
+                        // FIXME
                         break;
                 case 'G':
                         mop.mo_ldd.ldd_flags |= LDD_F_SV_TYPE_MGMT;
@@ -799,7 +804,7 @@ int main(int argc , char *const argv[])
         if (!(IS_MDT(&mop.mo_ldd) || IS_OST(&mop.mo_ldd) || 
               IS_MGMT(&mop.mo_ldd))) {
                 fatal();
-                fprintf(stderr, "must set server type :{mdt,ost,mgmt}\n");
+                fprintf(stderr, "must set target type :{mdt,ost,mgmt}\n");
                 usage(stderr);
                 exit(1);
         }
index 76528dc..c0b0644 100644 (file)
 
 #include "obdctl.h"
 
-int          verbose;
-int          nomtab;
-int          fake;
-int          force;
+int          verbose = 0;
+int          nomtab = 0;
+int          fake = 0;
+int          force = 0;
 static char *progname = NULL;
 
 void usage(FILE *out)