Whamcloud - gitweb
LU-13896 lnet: Fix reference leak in lnet_select_pathway 03/39603/3
authorChris Horn <chris.horn@hpe.com>
Wed, 5 Aug 2020 15:17:14 +0000 (10:17 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Sep 2020 18:08:44 +0000 (18:08 +0000)
We call lnet_nid2peerni_locked() to lookup the peer NI for the message
originator. lnet_nid2peerni_locked() takes a reference on the peer NI
that is never dropped.

Test-Parameters: trivial
Fixes: b0e8ab1a5f ("LU-13606 lnet: Allow router to forward to healthier NID")
HPE-bug-id: LUS-9185
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: Ie0e8f215d7becfbf33f905a1806da8513798ee8d
Reviewed-on: https://review.whamcloud.com/39603
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>

index 63e247c..a8c5f5b 100644 (file)
@@ -2767,6 +2767,8 @@ again:
                 * try to send it via non-multi-rail criteria
                if (!IS_ERR(src_lpni)) {
+                       /* Drop ref taken by lnet_nid2peerni_locked() */
+                       lnet_peer_ni_decref_locked(src_lpni);
                        src_lp = lpni->lpni_peer_net->lpn_peer;
                        if (lnet_peer_is_multi_rail(src_lp) &&