Whamcloud - gitweb
LU-10937 mgc: restore mgc binding for sptlrpc 11/33311/7
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 7 Nov 2018 14:08:30 +0000 (09:08 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 13 Nov 2018 06:16:08 +0000 (06:16 +0000)
The work for LU-9034 mapped config logs to separate mgc devices.
This change prevented the ability to configure sptlrpc. A later
work around was introduced in LU-9567. Recently it was reported
that the work around introduced can now cause a MGC failover
panic. This patch is the proper fix in that the sptlrpc is
properly bound to an mgc device.

The sptlrpc config record expects 2 pieces of data:

  *  [0]: fs_name/target_name,
  *  [1]: rule string

What was happening is that when you set cfg_instance it was used
to create a new instance name of the form fsname-%p. For sptlrpc
it expects it to only be fsname. The solution is to test if the
config record is for sptlrpc and in that can keep the first
record field as is. With this change we can drop cfg_obdname
which only sptlrpc used.

Test-Parameters: testlist=sanity-gss envdefinitions=ONLY=1,SHARED_KEY=true
Test-Parameters: testlist=sanity-sec envdefinitions=SHARED_KEY=true

Change-Id: I785f98264c6269f95c0d9a564b731d1b6ff0bcee
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/33311
Tested-by: Jenkins
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd_class.h
lustre/mgc/mgc_request.c
lustre/obdclass/obd_config.c

index 1cf3a7a..8682248 100644 (file)
@@ -189,7 +189,6 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg);
 
 /* Passed as data param to class_config_parse_llog */
 struct config_llog_instance {
-       char                    *cfg_obdname;
        void                    *cfg_instance;
        struct super_block      *cfg_sb;
        struct obd_uuid          cfg_uuid;
index 381a57a..430b01b 100644 (file)
@@ -235,10 +235,8 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd,
        /* Keep the mgc around until we are done */
        cld->cld_mgcexp = class_export_get(obd->obd_self_export);
 
-       if (cld_is_sptlrpc(cld)) {
+       if (cld_is_sptlrpc(cld))
                sptlrpc_conf_log_start(logname);
-               cld->cld_cfg.cfg_obdname = obd->obd_name;
-       }
 
        spin_lock(&config_list_lock);
        list_add(&cld->cld_list_chain, &config_llog_list);
@@ -297,9 +295,6 @@ static struct config_llog_data *config_log_find_or_add(struct obd_device *obd,
 
        lcfg.cfg_instance = sb != NULL ? (void *)sb : (void *)obd;
 
-       if (type == CONFIG_T_SPTLRPC)
-               lcfg.cfg_instance = NULL;
-
        cld = config_log_find(logname, &lcfg);
        if (unlikely(cld != NULL))
                return cld;
index c4a20e6..8d03b7b 100644 (file)
@@ -1711,6 +1711,7 @@ int class_config_llog_handler(const struct lu_env *env,
                lustre_cfg_bufs_init(&bufs, lcfg);
 
                if (cfg->cfg_instance &&
+                   lcfg->lcfg_command != LCFG_SPTLRPC_CONF &&
                    LUSTRE_CFG_BUFLEN(lcfg, 0) > 0) {
                        inst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) +
                                   sizeof(cfg->cfg_instance) * 2 + 4;
@@ -1739,14 +1740,16 @@ int class_config_llog_handler(const struct lu_env *env,
                  * moving them to index [1] and [2], and insert MGC's
                  * obdname at index [0].
                  */
-               if (cfg->cfg_instance == NULL &&
+               if (cfg->cfg_instance &&
                    lcfg->lcfg_command == LCFG_SPTLRPC_CONF) {
+                       struct obd_device *obd = cfg->cfg_instance;
+
                        lustre_cfg_bufs_set(&bufs, 2, bufs.lcfg_buf[1],
                                            bufs.lcfg_buflen[1]);
                        lustre_cfg_bufs_set(&bufs, 1, bufs.lcfg_buf[0],
                                            bufs.lcfg_buflen[0]);
                        lustre_cfg_bufs_set_string(&bufs, 0,
-                                                  cfg->cfg_obdname);
+                                                  obd->obd_name);
                }
 
                /* Add net info to setup command