From patchwork Thu Feb 27 21:10:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11409937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16B5B138D for ; Thu, 27 Feb 2020 21:26:08 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F34BC246A0 for ; Thu, 27 Feb 2020 21:26:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F34BC246A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 3DDBE348FA8; Thu, 27 Feb 2020 13:23:17 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 2240121FB65 for ; Thu, 27 Feb 2020 13:19:07 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 2FC8E2242; Thu, 27 Feb 2020 16:18:15 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 2EA0046C; Thu, 27 Feb 2020 16:18:15 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:10:30 -0500 Message-Id: <1582838290-17243-163-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 162/622] lustre: mgc: restore mgc binding for sptlrpc X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: James Simmons , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" 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. WC-bug-id: https://jira.whamcloud.com/browse/LU-10937 Lustre-commit: ca9300e53dc2 ("LU-10937 mgc: restore mgc binding for sptlrpc") Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/33311 Reviewed-by: Sebastien Buisson Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/include/obd_class.h | 1 - fs/lustre/mgc/mgc_request.c | 7 +------ fs/lustre/obdclass/obd_config.c | 5 ++++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/lustre/include/obd_class.h b/fs/lustre/include/obd_class.h index 742e92a..434bb79 100644 --- a/fs/lustre/include/obd_class.h +++ b/fs/lustre/include/obd_class.h @@ -166,7 +166,6 @@ int class_config_llog_handler(const struct lu_env *env, /* 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; diff --git a/fs/lustre/mgc/mgc_request.c b/fs/lustre/mgc/mgc_request.c index 785461b..5bfa1b7 100644 --- a/fs/lustre/mgc/mgc_request.c +++ b/fs/lustre/mgc/mgc_request.c @@ -224,10 +224,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); @@ -273,9 +271,6 @@ struct config_llog_data *do_config_log_add(struct obd_device *obd, lcfg.cfg_instance = sb ? (void *)sb : (void *)obd; - if (type == CONFIG_T_SPTLRPC) - lcfg.cfg_instance = NULL; - cld = config_log_find(logname, &lcfg); if (unlikely(cld)) return cld; diff --git a/fs/lustre/obdclass/obd_config.c b/fs/lustre/obdclass/obd_config.c index 550cee0..398f888 100644 --- a/fs/lustre/obdclass/obd_config.c +++ b/fs/lustre/obdclass/obd_config.c @@ -1357,6 +1357,7 @@ int class_config_llog_handler(const struct lu_env *env, lustre_cfg_bufs_init(&bufs, lcfg); if (clli && clli->cfg_instance && + lcfg->lcfg_command != LCFG_SPTLRPC_CONF && LUSTRE_CFG_BUFLEN(lcfg, 0) > 0) { inst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) + sizeof(clli->cfg_instance) * 2 + 4; @@ -1389,12 +1390,14 @@ int class_config_llog_handler(const struct lu_env *env, */ if (clli && !clli->cfg_instance && lcfg->lcfg_command == LCFG_SPTLRPC_CONF) { + struct obd_device *obd = clli->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, - clli->cfg_obdname); + obd->obd_name); } /* Add net info to setup command