From patchwork Thu Jan 30 14:11:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 13954685 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 CB402C0218F for ; Thu, 30 Jan 2025 14:49:23 +0000 (UTC) Received: from pdx1-mailman-customer002.dreamhost.com (localhost [127.0.0.1]) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTP id 4YkLlt0fPyz22Sn; Thu, 30 Jan 2025 06:20:42 -0800 (PST) Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTPS id 4YkLbM6ps7z1y8x for ; Thu, 30 Jan 2025 06:13:19 -0800 (PST) Received: from star2.ccs.ornl.gov (ltm3-e204-208.ccs.ornl.gov [160.91.203.26]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id 20B9718236D; Thu, 30 Jan 2025 09:11:33 -0500 (EST) Received: by star2.ccs.ornl.gov (Postfix, from userid 2004) id 1E6E8106BE18; Thu, 30 Jan 2025 09:11:33 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 30 Jan 2025 09:11:06 -0500 Message-ID: <20250130141115.950749-17-jsimmons@infradead.org> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20250130141115.950749-1-jsimmons@infradead.org> References: <20250130141115.950749-1-jsimmons@infradead.org> MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 16/25] lnet: Check empty list in cfs_match_nid_net 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 , Frank Sehr , Serguei Smirnov , Cyril Bordage , Lustre Development List Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Chris Horn cfs_match_nid_net() needs to check whether the list of range expressions describing the address is empty. Otherwise, for numeric based addresses, we may hit the assert in libcfs_num_match(). HPE-bug-id: LUS-11480 WC-bug-id: https://jira.whamcloud.com/browse/LU-16573 Lustre-commit: f3ba286b05d557b0d ("LU-16573 lnet: Check empty list in cfs_match_nid_net") Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50576 Reviewed-by: Serguei Smirnov Reviewed-by: Frank Sehr Reviewed-by: Cyril Bordage Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- net/lnet/lnet/nidstrings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/lnet/lnet/nidstrings.c b/net/lnet/lnet/nidstrings.c index d235048a8ff0..05a9b3275624 100644 --- a/net/lnet/lnet/nidstrings.c +++ b/net/lnet/lnet/nidstrings.c @@ -822,11 +822,11 @@ cfs_match_nid_net(struct lnet_nid *nid, u32 net_type, u32 address; struct netstrfns *nf; - if (!addr || !net_num_list) + if (!addr || list_empty(addr) || !net_num_list) return 0; nf = type2net_info(LNET_NETTYP(LNET_NID_NET(nid))); - if (!nf || !net_num_list || !addr) + if (!nf) return 0; /* FIXME handle long-addr nid */