Whamcloud - gitweb
* propagated openibnal fix (deleting an idle persistent peer) to voltaire
authoreeb <eeb>
Sun, 9 Jan 2005 19:59:19 +0000 (19:59 +0000)
committereeb <eeb>
Sun, 9 Jan 2005 19:59:19 +0000 (19:59 +0000)
    and infinicon NALs

lnet/klnds/iiblnd/iiblnd.c
lnet/klnds/viblnd/viblnd.c

index e59d066..5dc5192 100644 (file)
@@ -518,13 +518,19 @@ kibnal_del_peer_locked (kib_peer_t *peer, int single_share)
         if (peer->ibp_persistence != 0)
                 return;
 
-        list_for_each_safe (ctmp, cnxt, &peer->ibp_conns) {
-                conn = list_entry(ctmp, kib_conn_t, ibc_list);
+        if (list_empty(&peer->ibp_conns)) {
+                kibnal_unlink_peer_locked(peer);
+        } else {
+                list_for_each_safe (ctmp, cnxt, &peer->ibp_conns) {
+                        conn = list_entry(ctmp, kib_conn_t, ibc_list);
 
-                kibnal_close_conn_locked (conn, 0);
+                        kibnal_close_conn_locked (conn, 0);
+                }
+                /* NB peer is no longer persistent; closing its last conn
+                 * unlinked it. */
         }
-
-        /* NB peer unlinks itself when last conn is closed */
+        /* NB peer now unlinked; might even be freed if the peer table had the
+         * last ref on it. */
 }
 
 int
index 50e1149..1e1d2f4 100644 (file)
@@ -496,13 +496,19 @@ kibnal_del_peer_locked (kib_peer_t *peer, int single_share)
         if (peer->ibp_persistence != 0)
                 return;
 
-        list_for_each_safe (ctmp, cnxt, &peer->ibp_conns) {
-                conn = list_entry(ctmp, kib_conn_t, ibc_list);
+        if (list_empty(&peer->ibp_conns)) {
+                kibnal_unlink_peer_locked(peer);
+        } else {
+                list_for_each_safe (ctmp, cnxt, &peer->ibp_conns) {
+                        conn = list_entry(ctmp, kib_conn_t, ibc_list);
 
-                kibnal_close_conn_locked (conn, 0);
+                        kibnal_close_conn_locked (conn, 0);
+                }
+                /* NB peer is no longer persistent; closing its last conn
+                 * unlinked it. */
         }
-
-        /* NB peer unlinks itself when last conn is closed */
+        /* NB peer now unlinked; might even be freed if the peer table had the
+         * last ref on it. */
 }
 
 int