@@ -646,8 +646,10 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
LASSERT(!do_send || msg->msg_tx_delayed);
LASSERT(!msg->msg_receiving);
LASSERT(msg->msg_tx_committed);
+
/* can't get here if we're sending to the loopback interface */
- LASSERT(lp->lpni_nid != the_lnet.ln_loni->ni_nid);
+ if (the_lnet.ln_loni)
+ LASSERT(lp->lpni_nid != the_lnet.ln_loni->ni_nid);
/* NB 'lp' is always the next hop */
if (!(msg->msg_target.pid & LNET_PID_USERFLAG) &&
@@ -1576,6 +1578,9 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
struct lnet_msg *msg = sd->sd_msg;
int cpt = sd->sd_cpt;
+ if (the_lnet.ln_state != LNET_STATE_RUNNING)
+ return -ESHUTDOWN;
+
/* No send credit hassles with LOLND */
lnet_ni_addref_locked(the_lnet.ln_loni, cpt);
msg->msg_hdr.dest_nid = cpu_to_le64(the_lnet.ln_loni->ni_nid);