[lustre-devel] [PATCH 03/15] lnet: Fix reference leak in lnet_parse

James Simmons jsimmons at infradead.org
Mon Nov 8 07:07:31 PST 2021


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

We need to drop the reference taken by lnet_nid2peerni_locked() if we
determine that we need to drop the message because of asymmetric
route.

HPE-bug-id: LUS-9186
Fixes: 8d00758c6f ("lnet: Correct asymmetric route detection")
WC-bug-id: https://jira.whamcloud.com/browse/LU-15039
Lustre-commit: e69eca08bce47bf85 ("LU-15039 lnet: Fix reference leak in lnet_parse")
Signed-off-by: Chris Horn <chris.horn at hpe.com>
Reviewed-on: https://review.whamcloud.com/45067
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 net/lnet/lnet/lib-move.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index 2b38480..170d684 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -4433,6 +4433,8 @@ void lnet_monitor_thr_stop(void)
 			}
 		}
 		if (lnet_drop_asym_route && for_me && !found) {
+			/* Drop ref taken by lnet_nid2peerni_locked() */
+			lnet_peer_ni_decref_locked(lpni);
 			lnet_net_unlock(cpt);
 			/* we would not use from_nid to route a message to
 			 * src_nid
-- 
1.8.3.1



More information about the lustre-devel mailing list