Whamcloud - gitweb
LU-13648 lnet: Set remote NI status in lnet_notify
[fs/lustre-release.git] / lnet / lnet / router.c
index 3fb67db..35f8c5d 100644 (file)
@@ -1694,12 +1694,11 @@ lnet_notify(struct lnet_ni *ni, lnet_nid_t nid, bool alive, bool reset,
        time64_t now = ktime_get_seconds();
        int cpt;
 
-       LASSERT (!in_interrupt ());
+       LASSERT(!in_interrupt());
 
-       CDEBUG (D_NET, "%s notifying %s: %s\n",
-               (ni == NULL) ? "userspace" : libcfs_nid2str(ni->ni_nid),
-               libcfs_nid2str(nid),
-               alive ? "up" : "down");
+       CDEBUG(D_NET, "%s notifying %s: %s\n",
+              (ni == NULL) ? "userspace" : libcfs_nid2str(ni->ni_nid),
+              libcfs_nid2str(nid), alive ? "up" : "down");
 
        if (ni != NULL &&
            LNET_NIDNET(ni->ni_nid) != LNET_NIDNET(nid)) {
@@ -1742,6 +1741,7 @@ lnet_notify(struct lnet_ni *ni, lnet_nid_t nid, bool alive, bool reset,
 
        if (alive) {
                if (reset) {
+                       lpni->lpni_ns_status = LNET_NI_STATUS_UP;
                        lnet_set_lpni_healthv_locked(lpni,
                                                     LNET_MAX_HEALTH_VALUE);
                } else {
@@ -1752,6 +1752,8 @@ lnet_notify(struct lnet_ni *ni, lnet_nid_t nid, bool alive, bool reset,
                                        (sensitivity) ? sensitivity :
                                        lnet_health_sensitivity);
                }
+       } else if (reset) {
+               lpni->lpni_ns_status = LNET_NI_STATUS_DOWN;
        }
 
        /* recalculate aliveness */