]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorMark Andrews <marka@isc.org>
Fri, 16 Nov 2001 11:04:38 +0000 (11:04 +0000)
committerMark Andrews <marka@isc.org>
Fri, 16 Nov 2001 11:04:38 +0000 (11:04 +0000)
1129.   [bug]           Multithreaded servers could crash under heavy
                        resolution load due to a race condition. [RT #2018]

CHANGES
lib/dns/rbtdb.c

diff --git a/CHANGES b/CHANGES
index 412eb5ab5cedaefc88ebfb27ab8d1483faf87f5c..32d85fecd56eaf3642fcd558ef3ec043e9454ba5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1129.  [bug]           Multithreaded servers could crash under heavy
+                       resolution load due to a race condition. [RT #2018]
+
 1126.  [bug]           The server could access a freed event if shut
                        down while a client start event was pending
                        delivery. [RT #2061]
index bc2e540b297aaed172528cdb8b962c8a9b0c78c7..97a145b166b69e28984e61b3bd39e088b0e0719e 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rbtdb.c,v 1.168 2001/08/27 03:58:44 marka Exp $ */
+/* $Id: rbtdb.c,v 1.168.2.1 2001/11/16 11:04:38 marka Exp $ */
 
 /*
  * Principal Author: Bob Halley
@@ -746,7 +746,6 @@ no_references(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
 {
        isc_result_t result;
        isc_boolean_t write_locked;
-       isc_boolean_t reacquire;
        unsigned int locknum;
 
        /*
@@ -786,15 +785,12 @@ no_references(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
        /*
         * XXXDCL need to add a deferred delete method for ISC_R_LOCKBUSY.
         */
-       reacquire = ISC_FALSE;
        if (lock != isc_rwlocktype_write) {
                /*
-                * Free the node lock before acquiring a tree write lock, per
-                * the lock hierarchy rules stated at the start of this file.
+                * Locking hierarchy notwithstanding, we don't need to free
+                * the node lock before acquiring the tree write lock because
+                * we only do a trylock.
                 */
-               UNLOCK(&rbtdb->node_locks[locknum].lock);
-               reacquire = ISC_TRUE;
-
                if (lock == isc_rwlocktype_read)
                        RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_read);
 
@@ -804,7 +800,6 @@ no_references(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
                              result == ISC_R_LOCKBUSY);
  
                write_locked = ISC_TF(result == ISC_R_SUCCESS);
-
        } else
                write_locked = ISC_TRUE;
 
@@ -837,12 +832,6 @@ no_references(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
 
        if (lock == isc_rwlocktype_read)
                RWLOCK(&rbtdb->tree_lock, isc_rwlocktype_read);
-
-       /*
-        * Reacquire the node lock that the caller held if necessary.
-        */
-       if (reacquire)
-               LOCK(&rbtdb->node_locks[locknum].lock);
 }
 
 static inline void