@@ -1855,6 +1855,7 @@ struct lnet_peer_net *
int
lnet_add_peer_ni(struct lnet_nid *prim_nid, struct lnet_nid *nid, bool mr,
bool temp)
+__must_hold(&the_lnet.ln_api_mutex)
{
struct lnet_peer *lp = NULL;
struct lnet_peer_ni *lpni;
@@ -1906,6 +1907,13 @@ struct lnet_peer_net *
return -EPERM;
}
+ if (temp && lnet_peer_is_uptodate(lp)) {
+ CDEBUG(D_NET,
+ "Don't add temporary peer NI for uptodate peer %s\n",
+ libcfs_nidstr(&lp->lp_primary_nid));
+ return -EINVAL;
+ }
+
return lnet_peer_add_nid(lp, nid, flags);
}