[lustre-devel] [PATCH 16/25] lnet: Check empty list in cfs_match_nid_net

James Simmons <[email protected]> Thu, 30 Jan 2025 09:11:06 -0500
Newsgroups org.lustre.lists.lustre-devel
Message-ID <[email protected]>
From: Chris Horn <[email protected]>

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 <[email protected]>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50576
Reviewed-by: Serguei Smirnov <[email protected]>
Reviewed-by: Frank Sehr <[email protected]>
Reviewed-by: Cyril Bordage <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
Signed-off-by: James Simmons <[email protected]>
---
 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 */
-- 
2.39.3

_______________________________________________
lustre-devel mailing list
[email protected]
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org