From patchwork Sun Nov 20 14:16:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 13050056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman-customer002.dreamhost.com (listserver-buz.dreamhost.com [69.163.136.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E029C433FE for ; Sun, 20 Nov 2022 14:22:46 +0000 (UTC) Received: from pdx1-mailman-customer002.dreamhost.com (localhost [127.0.0.1]) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTP id 4NFXgg02Rrz1yDD; Sun, 20 Nov 2022 06:18:38 -0800 (PST) Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTPS id 4NFXf12MT8z1wM4 for ; Sun, 20 Nov 2022 06:17:13 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id B3BE010077F7; Sun, 20 Nov 2022 09:17:09 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id AC604E8B8B; Sun, 20 Nov 2022 09:17:09 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Sun, 20 Nov 2022 09:16:49 -0500 Message-Id: <1668953828-10909-4-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1668953828-10909-1-git-send-email-jsimmons@infradead.org> References: <1668953828-10909-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 03/22] lnet: Don't modify uptodate peer with temp NI X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Horn , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Chris Horn When processing the config log it is possible that we attempt to add temp NIs after discovery has completed on a peer. These temp may not actually exist on the peer. Since discovery has already completed the peer is considered up-to-date and we can end up with incorrect peer entries. We shouldn't add temp NIs to a peer that is already up-to-date. HPE-bug-id: LUS-10867 WC-bug-id: https://jira.whamcloud.com/browse/LU-15852 Lustre-commit: 8f718df474e453fbc ("LU-15852 lnet: Don't modify uptodate peer with temp NI") Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/47322 Reviewed-by: Frank Sehr Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- net/lnet/lnet/peer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/lnet/lnet/peer.c b/net/lnet/lnet/peer.c index d8d1857..52ad791 100644 --- a/net/lnet/lnet/peer.c +++ b/net/lnet/lnet/peer.c @@ -1855,6 +1855,7 @@ struct lnet_peer_net * int lnet_add_peer_ni(struct lnet_nid *prim_nid, struct lnet_nid *nid, bool mr, bool temp) +__must_hold(&the_lnet.ln_api_mutex) { struct lnet_peer *lp = NULL; struct lnet_peer_ni *lpni; @@ -1906,6 +1907,13 @@ struct lnet_peer_net * return -EPERM; } + if (temp && lnet_peer_is_uptodate(lp)) { + CDEBUG(D_NET, + "Don't add temporary peer NI for uptodate peer %s\n", + libcfs_nidstr(&lp->lp_primary_nid)); + return -EINVAL; + } + return lnet_peer_add_nid(lp, nid, flags); }