From: nathan Date: Thu, 12 Jan 2006 00:58:59 +0000 (+0000) Subject: Branch b1_4_mountconf X-Git-Tag: v1_8_0_110~486^4~67 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=1c85b016b11aea5355918acb54624936e01ad99e;p=fs%2Flustre-release.git Branch b1_4_mountconf 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 --- diff --git a/lustre/lov/lov_log.c b/lustre/lov/lov_log.c index 325d4b1..11f8e56 100644 --- a/lustre/lov/lov_log.c +++ b/lustre/lov/lov_log.c @@ -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; diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 1adcbff..02be24d 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -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); diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index f7f1250..e987e51 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -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, diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index df5ca72..8693107 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -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, diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index c9f0f53..9e8abd7 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -63,30 +63,35 @@ static char *ret_file = "/tmp/mkfs.log"; void usage(FILE *out) { - fprintf(out, "usage: %s [options] \n", progname); + fprintf(out, "usage: %s [options] \n", progname); fprintf(out, "\t: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(s) of a remote mgmt node\n" - "\t\t--fsname=\n" + "\toptions:\n" + "\t\t--mgmtnid=[,<...>] : NID(s) of a remote mgmt node\n" + "\t\t\trequired for all targets other than the mgmt node\n" + "\t\t--fsname= : default is 'lustre'\n" +#if 0 /* FIXME implement */ "\t\t--configdev=: store configuration info\n" "\t\t\tfor this device on an alternate device\n" - "\t\t--failover=\n" - "\t\t--backfstype=: 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=: permanent mount options\n" +#endif + "\t\t--failover=[,<...>] : list of NIDs for the failover\n" + "\t\t\tpartners for this target\n" + "\t\t--backfstype= : 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= : permanent mount options\n" #ifndef TUNEFS - "\t\t--mkfsoptions=: format options\n" + "\t\t--mkfsoptions= : format options\n" "\t\t--reformat: overwrite an existing disk\n" #endif - "\t\t--timeout=: system timeout period\n" + "\t\t--timeout= : 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); } diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 76528dc..c0b0644 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -37,10 +37,10 @@ #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)