From 06d7b25e75d46b935e7cecb255f02794a751813e Mon Sep 17 00:00:00 2001 From: Gregoire Pichon Date: Sat, 12 May 2018 21:43:18 -0400 Subject: [PATCH] LU-739 utils: remove references to lustre 1.4 upgrade flag Remove all references to LDD_F_UPGRADE14 flag since we don't support 1.4 upgrade any more. Also we can remove CFG_F_COMPAT146. Signed-off-by: Gregoire Pichon Signed-off-by: James Simmons Change-Id: Ib0ac680646751f9372923875142ce04ea5c8ec53 Reviewed-on: https://review.whamcloud.com/27342 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/include/obd_class.h | 1 - lustre/include/uapi/linux/lustre/lustre_disk.h | 2 +- lustre/mgc/mgc_request.c | 5 ---- lustre/mgs/mgs_handler.c | 32 ++++++++-------------- lustre/mgs/mgs_llog.c | 37 +++++++++++++------------- lustre/obdclass/obd_config.c | 6 ++--- lustre/utils/mkfs_lustre.c | 35 +++++++++--------------- lustre/utils/mount_lustre.c | 6 ----- 8 files changed, 45 insertions(+), 79 deletions(-) diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 2c52b36..b49db89 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -185,7 +185,6 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg); #define CFG_F_START 0x01 /* Set when we start updating from a log */ #define CFG_F_MARKER 0x02 /* We are within a maker */ #define CFG_F_SKIP 0x04 /* We should ignore this cfg command */ -#define CFG_F_COMPAT146 0x08 /* Allow old-style logs */ #define CFG_F_EXCLUDE 0x10 /* OST exclusion list */ /* Passed as data param to class_config_parse_llog */ diff --git a/lustre/include/uapi/linux/lustre/lustre_disk.h b/lustre/include/uapi/linux/lustre/lustre_disk.h index ab32e07..03aa1e6 100644 --- a/lustre/include/uapi/linux/lustre/lustre_disk.h +++ b/lustre/include/uapi/linux/lustre/lustre_disk.h @@ -90,7 +90,7 @@ /** regenerate config logs for this fs or server */ #define LDD_F_WRITECONF 0x0100 /** COMPAT_14 */ -#define LDD_F_UPGRADE14 0x0200 +/*#define LDD_F_UPGRADE14 0x0200 deprecated since 1.8 */ /** process as lctl conf_param */ #define LDD_F_PARAM 0x0400 /** all nodes are specified as service nodes */ diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 963e904..f640e0e 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -2208,11 +2208,6 @@ static int mgc_process_config(struct obd_device *obd, size_t len, void *buf) break; } - /* COMPAT_146 */ - /* FIXME only set this for old logs! Right now this forces - us to always skip the "inside markers" check */ - cld->cld_cfg.cfg_flags |= CFG_F_COMPAT146; - rc = mgc_process_log(obd, cld); if (rc == 0 && cld->cld_recover != NULL) { if (OCD_HAS_FLAG(&obd->u.cli.cl_import-> diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index fd23d9d..8e93215 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -438,8 +438,7 @@ static int mgs_target_reg(struct tgt_session_info *tsi) if (mti->mti_flags & LDD_F_NEED_INDEX) mti->mti_flags |= LDD_F_WRITECONF; - if (!(mti->mti_flags & (LDD_F_WRITECONF | LDD_F_UPGRADE14 | - LDD_F_UPDATE))) { + if (!(mti->mti_flags & (LDD_F_WRITECONF | LDD_F_UPDATE))) { /* We're just here as a startup ping. */ CDEBUG(D_MGS, "Server %s is running on %s\n", mti->mti_svname, obd_export_nid2str(tsi->tsi_exp)); @@ -499,8 +498,6 @@ static int mgs_target_reg(struct tgt_session_info *tsi) } mti->mti_flags |= LDD_F_UPDATE; - /* Erased logs means start from scratch. */ - mti->mti_flags &= ~LDD_F_UPGRADE14; } rc = mgs_find_or_make_fsdb(tsi->tsi_env, mgs, mti->mti_fsname, &c_fsdb); @@ -510,19 +507,13 @@ static int mgs_target_reg(struct tgt_session_info *tsi) GOTO(out_norevoke, rc); } - /* - * Log writing contention is handled by the fsdb_mutex. - * - * It should be alright if someone was reading while we were - * updating the logs - if we revoke at the end they will just update - * from where they left off. - */ - - if (mti->mti_flags & LDD_F_UPGRADE14) { - CERROR("Can't upgrade from 1.4 (%d)\n", rc); - GOTO(out, rc); - } - + /* + * Log writing contention is handled by the fsdb_mutex. + * + * It should be alright if someone was reading while we were + * updating the logs - if we revoke at the end they will just update + * from where they left off. + */ if (mti->mti_flags & LDD_F_UPDATE) { CDEBUG(D_MGS, "updating %s, index=%d\n", mti->mti_svname, mti->mti_stripe_index); @@ -536,10 +527,9 @@ static int mgs_target_reg(struct tgt_session_info *tsi) GOTO(out, rc); } - mti->mti_flags &= ~(LDD_F_VIRGIN | LDD_F_UPDATE | - LDD_F_NEED_INDEX | LDD_F_WRITECONF | - LDD_F_UPGRADE14); - mti->mti_flags |= LDD_F_REWRITE_LDD; + mti->mti_flags &= ~(LDD_F_VIRGIN | LDD_F_UPDATE | + LDD_F_NEED_INDEX | LDD_F_WRITECONF); + mti->mti_flags |= LDD_F_REWRITE_LDD; } out: diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index b3220e77..9b1877f 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -4266,27 +4266,26 @@ int mgs_write_log_target(const struct lu_env *env, struct mgs_device *mgs, mutex_lock(&fsdb->fsdb_mutex); - if (mti->mti_flags & - (LDD_F_VIRGIN | LDD_F_UPGRADE14 | LDD_F_WRITECONF)) { - /* Generate a log from scratch */ - if (mti->mti_flags & LDD_F_SV_TYPE_MDT) { + if (mti->mti_flags & (LDD_F_VIRGIN | LDD_F_WRITECONF)) { + /* Generate a log from scratch */ + if (mti->mti_flags & LDD_F_SV_TYPE_MDT) { rc = mgs_write_log_mdt(env, mgs, fsdb, mti); - } else if (mti->mti_flags & LDD_F_SV_TYPE_OST) { + } else if (mti->mti_flags & LDD_F_SV_TYPE_OST) { rc = mgs_write_log_ost(env, mgs, fsdb, mti); - } else { - CERROR("Unknown target type %#x, can't create log for " - "%s\n", mti->mti_flags, mti->mti_svname); - } - if (rc) { - CERROR("Can't write logs for %s (%d)\n", - mti->mti_svname, rc); - GOTO(out_up, rc); - } - } else { - /* Just update the params from tunefs in mgs_write_log_params */ - CDEBUG(D_MGS, "Update params for %s\n", mti->mti_svname); - mti->mti_flags |= LDD_F_PARAM; - } + } else { + CERROR("Unknown target type %#x, can't create log for %s\n", + mti->mti_flags, mti->mti_svname); + } + if (rc) { + CERROR("Can't write logs for %s (%d)\n", + mti->mti_svname, rc); + GOTO(out_up, rc); + } + } else { + /* Just update the params from tunefs in mgs_write_log_params */ + CDEBUG(D_MGS, "Update params for %s\n", mti->mti_svname); + mti->mti_flags |= LDD_F_PARAM; + } /* allocate temporary buffer, where class_get_next_param will make copy of a current parameter */ diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 86bae16..64aca1a 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -1619,9 +1619,9 @@ int class_config_llog_handler(const struct lu_env *env, } } /* A config command without a start marker before it is - illegal (post 146) */ - if (!(cfg->cfg_flags & CFG_F_COMPAT146) && - !(cfg->cfg_flags & CFG_F_MARKER) && + * illegal + */ + if (!(cfg->cfg_flags & CFG_F_MARKER) && (lcfg->lcfg_command != LCFG_MARKER)) { CWARN("Config not inside markers, ignoring! " "(inst: %p, uuid: %s, flags: %#x)\n", diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 0723107..6e25b13 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -188,17 +188,16 @@ void print_ldd(char *str, struct mkfs_opts *mop) printf("Lustre FS: %s\n", ldd->ldd_fsname); printf("Mount type: %s\n", MT_STR(ldd)); printf("Flags: %#x\n", ldd->ldd_flags); - printf(" (%s%s%s%s%s%s%s%s%s)\n", - IS_MDT(ldd) ? "MDT ":"", - IS_OST(ldd) ? "OST ":"", - IS_MGS(ldd) ? "MGS ":"", - ldd->ldd_flags & LDD_F_NEED_INDEX ? "needs_index ":"", - ldd->ldd_flags & LDD_F_VIRGIN ? "first_time ":"", - ldd->ldd_flags & LDD_F_UPDATE ? "update ":"", - ldd->ldd_flags & LDD_F_WRITECONF ? "writeconf ":"", - ldd->ldd_flags & LDD_F_NO_PRIMNODE? "no_primnode ":"", - ldd->ldd_flags & LDD_F_UPGRADE14 ? "upgrade1.4 ":""); - printf("Persistent mount opts: %s\n", ldd->ldd_mount_opts); + printf(" (%s%s%s%s%s%s%s%s)\n", + IS_MDT(ldd) ? "MDT " : "", + IS_OST(ldd) ? "OST " : "", + IS_MGS(ldd) ? "MGS " : "", + ldd->ldd_flags & LDD_F_NEED_INDEX ? "needs_index " : "", + ldd->ldd_flags & LDD_F_VIRGIN ? "first_time " : "", + ldd->ldd_flags & LDD_F_UPDATE ? "update " : "", + ldd->ldd_flags & LDD_F_WRITECONF ? "writeconf " : "", + ldd->ldd_flags & LDD_F_NO_PRIMNODE ? "no_primnode " : ""); + printf("Persistent mount opts: %s\n", ldd->ldd_mount_opts); osd_print_ldd_params(mop); if (ldd->ldd_userdata[0]) printf("Comment: %s\n", ldd->ldd_userdata); @@ -744,7 +743,7 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop, if (strlen(new_fsname) > 0) { if (!(mop->mo_flags & (MO_FORCEFORMAT | MO_RENAME)) && (!(ldd->ldd_flags & - (LDD_F_UPGRADE14 | LDD_F_VIRGIN | LDD_F_WRITECONF)))) { + (LDD_F_VIRGIN | LDD_F_WRITECONF)))) { fprintf(stderr, "%s: cannot change the name " "of a registered target\n", progname); return 1; @@ -754,8 +753,7 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop, } if (index_option && !(mop->mo_ldd.ldd_flags & - (LDD_F_UPGRADE14 | LDD_F_VIRGIN | - LDD_F_WRITECONF))) { + (LDD_F_VIRGIN | LDD_F_WRITECONF))) { fprintf(stderr, "%s: cannot change the index of" " a registered target\n", progname); return 1; @@ -904,15 +902,6 @@ int main(int argc, char *const argv[]) ldd->ldd_flags &= ~LDD_F_NEED_INDEX; } - if ((ldd->ldd_flags & (LDD_F_NEED_INDEX | LDD_F_UPGRADE14)) == - (LDD_F_NEED_INDEX | LDD_F_UPGRADE14)) { - fatal(); - fprintf(stderr, "Can't find the target index, " - "specify with --index\n"); - ret = EINVAL; - goto out; - } - if (ldd->ldd_flags & LDD_F_NEED_INDEX) fprintf(stderr, "warning: %s: for Lustre 2.4 and later, the " "target index must be specified with --index\n", diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index b2c742b..5d34176 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -490,12 +490,6 @@ static int parse_ldd(char *source, struct mount_opts *mop, return EINVAL; } - if (ldd->ldd_flags & LDD_F_UPGRADE14) { - fprintf(stderr, "%s: we cannot upgrade %s from this (very old) " - "Lustre version\n", progname, source); - return EINVAL; - } - if (ldd->ldd_flags & LDD_F_UPDATE) clear_update_ondisk(source, ldd); -- 1.8.3.1