Whamcloud - gitweb
LU-1078 lnet: two minor issues in lnet
[fs/lustre-release.git] / lnet / lnet / lib-move.c
index fb726e3..e7bb73e 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -923,6 +921,7 @@ lnet_ni_peer_alive(lnet_peer_t *lp)
 
         LASSERT (lnet_peer_aliveness_enabled(lp));
         LASSERT (ni->ni_lnd->lnd_query != NULL);
+        LASSERT (the_lnet.ln_routing == 1);
 
         LNET_UNLOCK();
         (ni->ni_lnd->lnd_query)(ni, lp->lp_nid, &last_alive);
@@ -932,7 +931,6 @@ lnet_ni_peer_alive(lnet_peer_t *lp)
 
         if (last_alive != 0) /* NI has updated timestamp */
                 lp->lp_last_alive = last_alive;
-        return;
 }
 
 /* NB: always called with LNET_LOCK held */
@@ -943,6 +941,7 @@ lnet_peer_is_alive (lnet_peer_t *lp, cfs_time_t now)
         cfs_time_t deadline;
 
         LASSERT (lnet_peer_aliveness_enabled(lp));
+        LASSERT (the_lnet.ln_routing == 1);
 
         /* Trust lnet_notify() if it has more recent aliveness news, but
          * ignore the initial assumed death (see lnet_peers_start_down()).
@@ -974,6 +973,10 @@ lnet_peer_alive_locked (lnet_peer_t *lp)
 {
         cfs_time_t now = cfs_time_current();
 
+        /* LU-630: only router checks peer health. */
+        if (the_lnet.ln_routing == 0)
+                return 1;
+
         if (!lnet_peer_aliveness_enabled(lp))
                 return -ENODEV;