2138. [bug] Lock order reversal in resolver.c. [RT #16653]

This commit is contained in:
Mark Andrews
2007-02-14 23:40:01 +00:00
parent 4490e14feb
commit 10fc76d48a
2 changed files with 9 additions and 7 deletions

View File

@@ -1,3 +1,5 @@
2138. [bug] Lock order reversal in resolver.c. [RT #16653]
2137. [port] Mips little endian and/or mips 64 bit are now
supported for atomic operations. [RT#16648]

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.342 2007/02/07 04:49:18 marka Exp $ */
/* $Id: resolver.c,v 1.343 2007/02/14 23:40:01 marka Exp $ */
/*! \file */
@@ -6634,6 +6634,7 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
isc_boolean_t new_fctx = ISC_FALSE;
isc_event_t *event;
unsigned int count = 0;
unsigned int spillat;
UNUSED(forwarders);
@@ -6662,6 +6663,9 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
bucketnum = dns_name_fullhash(name, ISC_FALSE) % res->nbuckets;
LOCK(&res->lock);
spillat = res->spillat;
UNLOCK(&res->lock);
LOCK(&res->buckets[bucketnum].lock);
if (res->buckets[bucketnum].exiting) {
@@ -6695,12 +6699,8 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
}
}
if (count >= res->spillatmin && res->spillatmin != 0) {
if (!fctx->spilled) {
LOCK(&fctx->res->lock);
if (count >= res->spillat)
fctx->spilled = ISC_TRUE;
UNLOCK(&fctx->res->lock);
}
if (count >= spillat)
fctx->spilled = ISC_TRUE;
if (fctx->spilled) {
result = DNS_R_DROP;
goto unlock;