mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-30 14:25:47 -04:00
pullup:
DNS_ZONEFLG_FLUSH was not being cleared. dns_zone_flush() could return a misleading result. If the zone was being dumped incrementaly when dns_zone_flush() was called ensure that it gets redumped if the were still outstanding changes.
This commit is contained in:
parent
4cedbe5d3b
commit
4eabedb01f
1 changed files with 14 additions and 6 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: zone.c,v 1.333.2.23.2.10 2003/08/13 02:08:45 marka Exp $ */
|
||||
/* $Id: zone.c,v 1.333.2.23.2.11 2003/08/13 02:24:31 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -2163,7 +2163,7 @@ dns_zone_refresh(dns_zone_t *zone) {
|
|||
|
||||
isc_result_t
|
||||
dns_zone_flush(dns_zone_t *zone) {
|
||||
isc_result_t result = ISC_R_ALREADYRUNNING;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
isc_boolean_t dumping;
|
||||
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
|
@ -2171,9 +2171,10 @@ dns_zone_flush(dns_zone_t *zone) {
|
|||
LOCK_ZONE(zone);
|
||||
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_FLUSH);
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDDUMP) &&
|
||||
zone->masterfile != NULL)
|
||||
zone->masterfile != NULL) {
|
||||
result = ISC_R_ALREADYRUNNING;
|
||||
dumping = was_dumping(zone);
|
||||
else
|
||||
} else
|
||||
dumping = ISC_TRUE;
|
||||
UNLOCK_ZONE(zone);
|
||||
if (!dumping)
|
||||
|
|
@ -2237,6 +2238,7 @@ dump_done(void *arg, isc_result_t result) {
|
|||
dns_zone_t *zone = arg;
|
||||
dns_db_t *db;
|
||||
dns_dbversion_t *version;
|
||||
isc_boolean_t again = ISC_FALSE;
|
||||
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
||||
|
|
@ -2288,9 +2290,14 @@ dump_done(void *arg, isc_result_t result) {
|
|||
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_NEEDDUMP);
|
||||
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_DUMPING);
|
||||
isc_time_settoepoch(&zone->dumptime);
|
||||
}
|
||||
again = ISC_TRUE;
|
||||
} else if (result == ISC_R_SUCCESS)
|
||||
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_FLUSH);
|
||||
|
||||
dns_dumpctx_detach(&zone->dctx);
|
||||
UNLOCK_ZONE(zone);
|
||||
if (again)
|
||||
(void)zone_dump(zone, ISC_FALSE);
|
||||
zonemgr_putio(&zone->writeio);
|
||||
dns_zone_idetach(&zone);
|
||||
}
|
||||
|
|
@ -2370,7 +2377,8 @@ zone_dump(dns_zone_t *zone, isc_boolean_t compact) {
|
|||
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_DUMPING);
|
||||
isc_time_settoepoch(&zone->dumptime);
|
||||
again = ISC_TRUE;
|
||||
}
|
||||
} else
|
||||
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_FLUSH);
|
||||
UNLOCK_ZONE(zone);
|
||||
if (again)
|
||||
goto redo;
|
||||
|
|
|
|||
Loading…
Reference in a new issue