From 213c41c9f7b7c873b51933a109a3b7bda93ee204 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 13 Sep 2013 09:52:15 -0700 Subject: [PATCH] [master] fix to change #3647 --- lib/dns/zone.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 0f632a05b4..bc33cacfc9 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -4475,12 +4475,9 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, static isc_boolean_t exit_check(dns_zone_t *zone) { - REQUIRE(LOCKED_ZONE(zone)); - if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_SHUTDOWN) && - zone->irefs == 0) - { + if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_SHUTDOWN) && zone->irefs == 0) { /* * DNS_ZONEFLG_SHUTDOWN can only be set if erefs == 0. */ @@ -11752,7 +11749,6 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) { zone->statelist = NULL; } RWUNLOCK(&zone->zmgr->rwlock, isc_rwlocktype_write); - dns_zonemgr_releasezone(zone->zmgr, zone); } /* @@ -11761,6 +11757,10 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) { if (zone->xfr != NULL) dns_xfrin_shutdown(zone->xfr); + /* Safe to release the zone now */ + if (zone->zmgr != NULL) + dns_zonemgr_releasezone(zone->zmgr, zone); + LOCK_ZONE(zone); INSIST(zone != zone->raw); if (linked) {