Whamcloud - gitweb
- should init kptllnd_data.kptl_idle_txs before calling kptllnd_shutdown.
authorisaac <isaac>
Tue, 12 Jun 2007 19:17:12 +0000 (19:17 +0000)
committerisaac <isaac>
Tue, 12 Jun 2007 19:17:12 +0000 (19:17 +0000)
-   should init kptllnd_data.kptl_ptlid2str_lock before calling kptllnd_ptlid2str.

lnet/ChangeLog
lnet/klnds/ptllnd/ptllnd.c

index 6ebdfea..15e76fb 100644 (file)
        ptllnd    - Portals 3.3 / UNICOS/lc 1.5.x, 2.0.x
        * bug fixes
        
+Severity   : minor
+Frequency  : rare
+Description: Ptllnd didn't init kptllnd_data.kptl_idle_txs before it could be
+            possibly accessed in kptllnd_shutdown. Ptllnd should init 
+            kptllnd_data.kptl_ptlid2str_lock before calling kptllnd_ptlid2str.
+
 Severity   : normal
 Frequency  : rare
 Description: gmlnd ignored some transmit errors when finalizing lnet messages.
index fd707f3..f020fac 100755 (executable)
@@ -471,7 +471,7 @@ kptllnd_startup (lnet_ni_t *ni)
         }
 
         if (*kptllnd_tunables.kptl_max_procs_per_node < 1) {
-                CERROR("max_procs_per_node must be > 1\n");
+                CERROR("max_procs_per_node must be >= 1\n");
                 return -EINVAL;
         }
 
@@ -491,6 +491,25 @@ kptllnd_startup (lnet_ni_t *ni)
         kptllnd_data.kptl_nih = PTL_INVALID_HANDLE;
 
         /*
+         * Setup the sched locks/lists/waitq
+         */
+        spin_lock_init(&kptllnd_data.kptl_sched_lock);
+        init_waitqueue_head(&kptllnd_data.kptl_sched_waitq);
+        INIT_LIST_HEAD(&kptllnd_data.kptl_sched_txq);
+        INIT_LIST_HEAD(&kptllnd_data.kptl_sched_rxq);
+        INIT_LIST_HEAD(&kptllnd_data.kptl_sched_rxbq);
+
+        /* init kptl_ptlid2str_lock before any call to kptllnd_ptlid2str */
+        spin_lock_init(&kptllnd_data.kptl_ptlid2str_lock);
+
+        /*
+         * Setup the tx locks/lists
+         */
+        spin_lock_init(&kptllnd_data.kptl_tx_lock);
+        INIT_LIST_HEAD(&kptllnd_data.kptl_idle_txs);
+        atomic_set(&kptllnd_data.kptl_ntx, 0);
+
+        /*
          * Uptick the module reference count
          */
         PORTAL_MODULE_USE;
@@ -586,22 +605,6 @@ kptllnd_startup (lnet_ni_t *ni)
         CDEBUG(D_NET, "Incarnation="LPX64"\n", kptllnd_data.kptl_incarnation);
 
         /*
-         * Setup the sched locks/lists/waitq
-         */
-        spin_lock_init(&kptllnd_data.kptl_sched_lock);
-        init_waitqueue_head(&kptllnd_data.kptl_sched_waitq);
-        INIT_LIST_HEAD(&kptllnd_data.kptl_sched_txq);
-        INIT_LIST_HEAD(&kptllnd_data.kptl_sched_rxq);
-        INIT_LIST_HEAD(&kptllnd_data.kptl_sched_rxbq);
-
-        /*
-         * Setup the tx locks/lists
-         */
-        spin_lock_init(&kptllnd_data.kptl_tx_lock);
-        INIT_LIST_HEAD(&kptllnd_data.kptl_idle_txs);
-        atomic_set(&kptllnd_data.kptl_ntx, 0);
-
-        /*
          * Allocate and setup the peer hash table
          */
         rwlock_init(&kptllnd_data.kptl_peer_rw_lock);
@@ -609,8 +612,6 @@ kptllnd_startup (lnet_ni_t *ni)
         INIT_LIST_HEAD(&kptllnd_data.kptl_closing_peers);
         INIT_LIST_HEAD(&kptllnd_data.kptl_zombie_peers);
 
-        spin_lock_init(&kptllnd_data.kptl_ptlid2str_lock);
-
         kptllnd_data.kptl_peer_hash_size =
                 *kptllnd_tunables.kptl_peer_hash_table_size;
         LIBCFS_ALLOC(kptllnd_data.kptl_peers,