[lkml]   [2016]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 76/80] staging: lustre: lnet: Do not drop message when shutting down LNet
From: Doug Oucharek <>

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 <>
Reviewed-by: James Simmons <>
Reviewed-by: Liang Zhen <>
Reviewed-by: Oleg Drokin <>
Signed-off-by: James Simmons <>
drivers/staging/lustre/lnet/lnet/lib-move.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 6a3f2e1..5598fa8 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -2002,6 +2002,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;

 \ /
  Last update: 2016-09-17 09:57    [W:0.245 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site