Whamcloud - gitweb
LU-739 utils: remove references to lustre 1.4 upgrade flag 42/27342/6
authorGregoire Pichon <gregoire.pichon@bull.net>
Sun, 13 May 2018 01:43:18 +0000 (21:43 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 21 May 2018 16:51:45 +0000 (16:51 +0000)
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 <gregoire.pichon@bull.net>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Change-Id: Ib0ac680646751f9372923875142ce04ea5c8ec53
Reviewed-on: https://review.whamcloud.com/27342
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd_class.h
lustre/include/uapi/linux/lustre/lustre_disk.h
lustre/mgc/mgc_request.c
lustre/mgs/mgs_handler.c
lustre/mgs/mgs_llog.c
lustre/obdclass/obd_config.c
lustre/utils/mkfs_lustre.c
lustre/utils/mount_lustre.c

index 2c52b36..b49db89 100644 (file)
@@ -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 */
index ab32e07..03aa1e6 100644 (file)
@@ -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 */
index 963e904..f640e0e 100644 (file)
@@ -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->
index fd23d9d..8e93215 100644 (file)
@@ -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:
index b3220e7..9b1877f 100644 (file)
@@ -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 */
index 86bae16..64aca1a 100644 (file)
@@ -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",
index 0723107..6e25b13 100644 (file)
@@ -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",
index b2c742b..5d34176 100644 (file)
@@ -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);