From patchwork Thu Feb 27 21:17:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410821 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 8545A924 for ; Thu, 27 Feb 2020 21:47:41 +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 6DE1A24690 for ; Thu, 27 Feb 2020 21:47:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DE1A24690 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 E084F34A1EC; Thu, 27 Feb 2020 13:37:41 -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 D0D5F21FD3A for ; Thu, 27 Feb 2020 13:21:21 -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 2E842A146; Thu, 27 Feb 2020 16:18:20 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 2D65446A; Thu, 27 Feb 2020 16:18:20 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:17:35 -0500 Message-Id: <1582838290-17243-588-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 587/622] lustre: ptlrpc: suppress connection restored message 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: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Alex Zhuravlev if that happens on idling connection. Fixes: 4b102da53ad ("lustre: ptlrpc: idle connections can disconnect") WC-bug-id: https://jira.whamcloud.com/browse/LU-13098 Lustre-commit: 7aa58847b94d ("LU-13098 ptlrpc: supress connection restored message") Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/37086 Reviewed-by: Andreas Dilger Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/include/lustre_import.h | 8 ++++++-- fs/lustre/ptlrpc/import.c | 25 ++++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/fs/lustre/include/lustre_import.h b/fs/lustre/include/lustre_import.h index 501a896..5d548a6 100644 --- a/fs/lustre/include/lustre_import.h +++ b/fs/lustre/include/lustre_import.h @@ -304,8 +304,12 @@ struct obd_import { imp_connect_tried:1, /* connected but not FULL yet */ imp_connected:1, - /* grant shrink disabled */ - imp_grant_shrink_disabled:1; + /* grant shrink disabled */ + imp_grant_shrink_disabled:1, + /* to suppress LCONSOLE() at + * conn.restore + */ + imp_was_idle:1; u32 imp_connect_op; u32 imp_idle_timeout; diff --git a/fs/lustre/ptlrpc/import.c b/fs/lustre/ptlrpc/import.c index 028dd65..23dac39 100644 --- a/fs/lustre/ptlrpc/import.c +++ b/fs/lustre/ptlrpc/import.c @@ -1519,21 +1519,22 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp) import_set_state(imp, LUSTRE_IMP_RECOVER); if (imp->imp_state == LUSTRE_IMP_RECOVER) { - CDEBUG(D_HA, "reconnected to %s@%s\n", - obd2cli_tgt(imp->imp_obd), - imp->imp_connection->c_remote_uuid.uuid); + struct ptlrpc_connection *conn = imp->imp_connection; rc = ptlrpc_resend(imp); if (rc) goto out; ptlrpc_activate_import(imp, true); - deuuidify(obd2cli_tgt(imp->imp_obd), NULL, - &target_start, &target_len); - LCONSOLE_INFO("%s: Connection restored to %.*s (at %s)\n", - imp->imp_obd->obd_name, - target_len, target_start, - obd_import_nid2str(imp)); + CDEBUG_LIMIT(imp->imp_was_idle ? + imp->imp_idle_debug : D_CONSOLE, + "%s: Connection restored to %s (at %s)\n", + imp->imp_obd->obd_name, + obd_uuid2str(&conn->c_remote_uuid), + obd_import_nid2str(imp)); + spin_lock(&imp->imp_lock); + imp->imp_was_idle = 0; + spin_unlock(&imp->imp_lock); } if (imp->imp_state == LUSTRE_IMP_FULL) { @@ -1749,6 +1750,12 @@ int ptlrpc_disconnect_and_idle_import(struct obd_import *imp) CDEBUG_LIMIT(imp->imp_idle_debug, "%s: disconnect after %llus idle\n", imp->imp_obd->obd_name, ktime_get_real_seconds() - imp->imp_last_reply_time); + + /* don't make noise at reconnection */ + spin_lock(&imp->imp_lock); + imp->imp_was_idle = 1; + spin_unlock(&imp->imp_lock); + req->rq_interpret_reply = ptlrpc_disconnect_idle_interpret; ptlrpcd_add_req(req);