From 4937c3ccca8a3a3f8d5fdd2e5007d65773fcadc5 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Fri, 22 Mar 2024 15:02:55 -0600 Subject: [PATCH] LU-17664 lnet: LNetPrimaryNID returns wrong NID This is a regression introduced by the b2_15 port of Lustre-change: https://review.whamcloud.com/50159 Lustre-commit: fc7a0d6013b46ebc17cdfdccc04a5d1d92c6af24 This port assigned the return value to the wrong variable. As a result, LNetPrimaryNID() will always return the same value that was passed in as an argument. Fix the issue by assigning the return value to the correct variable. Test-Parameters: trivial Fixes: 6cfc8e55a2 ("LU-14668 lnet: add 'lock_prim_nid" lnet module parameter") Signed-off-by: Chris Horn Change-Id: I10e334d38e8c257239ae3fa82d0aea4f87d8ba69 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54537 Reviewed-by: Serguei Smirnov Reviewed-by: Andreas Dilger Reviewed-by: Cyril Bordage Reviewed-by: Frank Sehr Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lnet/lnet/peer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index 4eb7a44..4ba681a 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -1501,14 +1501,14 @@ again: /* DD disabled, nothing to do */ if (lnet_peer_discovery_disabled) { - nid = lnet_nid_to_nid4(&lp->lp_primary_nid); + primary_nid = lnet_nid_to_nid4(&lp->lp_primary_nid); spin_unlock(&lp->lp_lock); goto out_decref; } /* Peer already up to date, nothing to do */ if (lnet_peer_is_uptodate_locked(lp)) { - nid = lnet_nid_to_nid4(&lp->lp_primary_nid); + primary_nid = lnet_nid_to_nid4(&lp->lp_primary_nid); spin_unlock(&lp->lp_lock); goto out_decref; } @@ -1541,7 +1541,7 @@ again: if (!lock_prim_nid && !lnet_is_discovery_disabled(lp)) goto again; - nid = lnet_nid_to_nid4(&lp->lp_primary_nid); + primary_nid = lnet_nid_to_nid4(&lp->lp_primary_nid); out_decref: lnet_peer_ni_decref_locked(lpni); out_unlock: -- 1.8.3.1