@@ -499,12 +499,14 @@ static void lnet_peer_cancel_discovery(struct lnet_peer *lp)
static int
lnet_peer_del(struct lnet_peer *peer)
{
+ int rc;
+
lnet_peer_cancel_discovery(peer);
lnet_net_lock(LNET_LOCK_EX);
- lnet_peer_del_locked(peer);
+ rc = lnet_peer_del_locked(peer);
lnet_net_unlock(LNET_LOCK_EX);
- return 0;
+ return rc;
}
/*
@@ -1648,7 +1650,9 @@ struct lnet_peer_net *
}
}
/* Delete and recreate as a configured peer. */
- lnet_peer_del(lp);
+ rc = lnet_peer_del(lp);
+ if (rc)
+ goto out;
}
/* Create peer, peer_net, and peer_ni. */
@@ -3238,6 +3242,7 @@ static int lnet_peer_deletion(struct lnet_peer *lp)
struct list_head rlist;
struct lnet_route *route, *tmp;
int sensitivity = lp->lp_health_sensitivity;
+ int rc;
INIT_LIST_HEAD(&rlist);
@@ -3271,7 +3276,10 @@ static int lnet_peer_deletion(struct lnet_peer *lp)
lnet_net_unlock(LNET_LOCK_EX);
/* lnet_peer_del() deletes all the peer NIs owned by this peer */
- lnet_peer_del(lp);
+ rc = lnet_peer_del(lp);
+ if (rc)
+ CNETERR("Internal error: Unable to delete peer %s rc %d\n",
+ libcfs_nidstr(&lp->lp_primary_nid), rc);
list_for_each_entry_safe(route, tmp,
&rlist, lr_list) {