Whamcloud - gitweb
LU-8106 lnet: Do not drop message when shutting down LNet 93/19993/2
authorDoug Oucharek <doug.s.oucharek@intel.com>
Wed, 2 Mar 2016 04:08:00 +0000 (12:08 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 22 Jun 2016 02:54:23 +0000 (02:54 +0000)
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 <doug.s.oucharek@intel.com>
Change-Id: Ia8dba848e88b02ed23e2e77adb702c7ad0e60628
Reviewed-on: http://review.whamcloud.com/19993
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>

index 0df68dc..cd7c0e9 100644 (file)
@@ -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);
+               if (rc == -ESHUTDOWN)
+                       /* We are shutting down.  Don't do anything more */
+                       return 0;
                goto drop;