@@ -2336,7 +2336,9 @@ struct lnet_ni *
/* queue message and return */
msg->msg_rtr_nid_param = rtr_nid;
msg->msg_sending = 0;
+ spin_lock(&peer->lp_lock);
list_add_tail(&msg->msg_list, &peer->lp_dc_pendq);
+ spin_unlock(&peer->lp_lock);
lnet_peer_ni_decref_locked(lpni);
primary_nid = peer->lp_primary_nid;
lnet_net_unlock(cpt);
@@ -254,7 +254,9 @@
* Releasing the lock can cause an inconsistent state
*/
spin_lock(&the_lnet.ln_msg_resend_lock);
+ spin_lock(&lp->lp_lock);
list_splice(&lp->lp_dc_pendq, &the_lnet.ln_msg_resend);
+ spin_unlock(&lp->lp_lock);
spin_unlock(&the_lnet.ln_msg_resend_lock);
wake_up(&the_lnet.ln_dc_waitq);
@@ -1778,7 +1780,9 @@ static void lnet_peer_discovery_complete(struct lnet_peer *lp)
libcfs_nid2str(lp->lp_primary_nid));
list_del_init(&lp->lp_dc_list);
+ spin_lock(&lp->lp_lock);
list_splice_init(&lp->lp_dc_pendq, &pending_msgs);
+ spin_unlock(&lp->lp_lock);
wake_up_all(&lp->lp_dc_waitq);
lnet_net_unlock(LNET_LOCK_EX);