Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
3
-
9223372036854775807
Description
The backport causes reference loss on an lnet_peer_ni if its parent peer has the LNET_PEER_LOCK_PRIMARY bit set:
diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c
index 7a438ea086..01eb9aa8aa 100644
--- a/lnet/lnet/peer.c
+++ b/lnet/lnet/peer.c
@@ -546,6 +546,15 @@ lnet_peer_del_nid(struct lnet_peer *lp, lnet_nid_t nid4, unsigned int flags)
}
lpni = lnet_peer_ni_find_locked(&nid);
+ /* If we're asked to lock down the primary NID we shouldn't be
+ * deleting it
+ */
+ if (lp->lp_state & LNET_PEER_LOCK_PRIMARY &&
+ nid_same(&primary_nid, &nid)) {
+ rc = -EPERM;
+ goto out; <<< Ref taken by lnet_peer_ni_find_locked() is not dropped
+ }
+
if (!lpni) {
rc = -ENOENT;
goto out;