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

James Simmons jsimmons at infradead.org
Thu Jan 30 06:11:06 PST 2025


From: Chris Horn <chris.horn at hpe.com>

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 <chris.horn at hpe.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50576
Reviewed-by: Serguei Smirnov <ssmirnov at whamcloud.com>
Reviewed-by: Frank Sehr <fsehr at whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 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



More information about the lustre-devel mailing list