[lustre-devel] [PATCH 592/622] lnet: peer lookup handle shutdown

James Simmons jsimmons at infradead.org
Thu Feb 27 13:17:40 PST 2020


From: Amir Shehata <ashehata at whamcloud.com>

When LNet is shutting down, looking up peer_nis shouldn't assert
but return NULL. Callers handle NULL return

WC-bug-id: https://jira.whamcloud.com/browse/LU-13049
Lustre-commit: f46b22aa6a28 ("LU-13049 lnet: peer lookup handle shutdown")
Signed-off-by: Amir Shehata <ashehata at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36925
Reviewed-by: Serguei Smirnov <ssmirnov at whamcloud.com>
Reviewed-by: Neil Brown <neilb at suse.de>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 net/lnet/lnet/peer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/lnet/lnet/peer.c b/net/lnet/lnet/peer.c
index b168c97..f987fff 100644
--- a/net/lnet/lnet/peer.c
+++ b/net/lnet/lnet/peer.c
@@ -647,7 +647,8 @@ void lnet_peer_uninit(void)
 	struct list_head *peers;
 	struct lnet_peer_ni *lp;
 
-	LASSERT(the_lnet.ln_state == LNET_STATE_RUNNING);
+	if (the_lnet.ln_state != LNET_STATE_RUNNING)
+		return NULL;
 
 	peers = &ptable->pt_hash[lnet_nid2peerhash(nid)];
 	list_for_each_entry(lp, peers, lpni_hashlist) {
-- 
1.8.3.1



More information about the lustre-devel mailing list