From 47b7b319783f27023b0cefe54a2a2eea678284f2 Mon Sep 17 00:00:00 2001 From: Doug Oucharek Date: Wed, 2 Mar 2016 12:08:00 +0800 Subject: [PATCH] LU-8106 lnet: Do not drop message when shutting down LNet There is a case in lnet_parse() where we discover that LNet is shutting down but we continue to use the NI when we drop the message and end up calling ko2iblnd_check_send_locked() which tries to allocate from the Tx pool which has been cleaned up already. This triggers a NULL pointer dereference. This fix just returns from lnet_parse() when we disover LNet is shutting down. Signed-off-by: Doug Oucharek Change-Id: Ia8dba848e88b02ed23e2e77adb702c7ad0e60628 Reviewed-on: http://review.whamcloud.com/19993 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Liang Zhen Reviewed-by: Oleg Drokin --- lnet/lnet/lib-move.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 0df68dc..cd7c0e9 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1991,6 +1991,9 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid, libcfs_nid2str(from_nid), libcfs_nid2str(src_nid), lnet_msgtyp2str(type), rc); lnet_msg_free(msg); + if (rc == -ESHUTDOWN) + /* We are shutting down. Don't do anything more */ + return 0; goto drop; } -- 1.8.3.1