From: Mark Andrews Date: Thu, 2 Dec 2010 04:58:13 +0000 (+0000) Subject: 2975. [bug] rbtdb.c:cleanup_dead_nodes_callback() aquired the X-Git-Tag: v9.8.0-P1~313 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=97664670d0e45ec865da407112fceb892133eaf3;p=thirdparty%2Fbind9.git 2975. [bug] rbtdb.c:cleanup_dead_nodes_callback() aquired the wrong lock which could lead to server deadlock. [RT #22614] --- diff --git a/CHANGES b/CHANGES index 318f638997d..00df744b4f7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +2975. [bug] rbtdb.c:cleanup_dead_nodes_callback() aquired the + wrong lock which could lead to server deadlock. + [RT #22614] + 2974. [bug] Some vaild UPDATE requests could fail due to a consistency check examining the existing version of the zone rather than the new version resulting diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 5f3b95bcb59..0b120d79e71 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.306 2010/11/16 06:46:44 marka Exp $ */ +/* $Id: rbtdb.c,v 1.307 2010/12/02 04:58:13 marka Exp $ */ /*! \file */ @@ -2115,7 +2115,7 @@ cleanup_dead_nodes_callback(isc_task_t *task, isc_event_t *event) { unsigned int locknum; unsigned int refs; - RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write); + RWLOCK(&rbtdb->tree_lock, isc_rwlocktype_write); for (locknum = 0; locknum < rbtdb->node_lock_count; locknum++) { NODE_LOCK(&rbtdb->node_locks[locknum].lock, isc_rwlocktype_write); @@ -2125,7 +2125,7 @@ cleanup_dead_nodes_callback(isc_task_t *task, isc_event_t *event) { NODE_UNLOCK(&rbtdb->node_locks[locknum].lock, isc_rwlocktype_write); } - RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write); + RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_write); if (again) isc_task_send(task, &event); else {