mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 09:20:01 -04:00
Revert "Process db callbacks in zone_loaddone() after zone_postload()"
This reverts commita719647023. The commit introduced a data race, because dns_db_endload() is called after unfreezing the zone. (not cherry picked from commit593dea871a)
This commit is contained in:
parent
8ccdf53fa9
commit
6834ea968e
1 changed files with 9 additions and 13 deletions
|
|
@ -17843,6 +17843,13 @@ zone_loaddone(void *arg, isc_result_t result) {
|
|||
dns_zone_catz_disable_db(zone, load->db);
|
||||
}
|
||||
|
||||
tresult = dns_db_endload(load->db, &load->callbacks);
|
||||
if (tresult != ISC_R_SUCCESS &&
|
||||
(result == ISC_R_SUCCESS || result == DNS_R_SEENINCLUDE))
|
||||
{
|
||||
result = tresult;
|
||||
}
|
||||
|
||||
/*
|
||||
* Lock hierarchy: zmgr, zone, raw.
|
||||
*/
|
||||
|
|
@ -17861,14 +17868,10 @@ again:
|
|||
goto again;
|
||||
}
|
||||
}
|
||||
tresult = zone_postload(zone, load->db, load->loadtime, result);
|
||||
if (tresult != ISC_R_SUCCESS &&
|
||||
(result == ISC_R_SUCCESS || result == DNS_R_SEENINCLUDE))
|
||||
{
|
||||
result = tresult;
|
||||
}
|
||||
(void)zone_postload(zone, load->db, load->loadtime, result);
|
||||
zonemgr_putio(&zone->readio);
|
||||
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_LOADING);
|
||||
zone_idetach(&load->callbacks.zone);
|
||||
/*
|
||||
* Leave the zone frozen if the reload fails.
|
||||
*/
|
||||
|
|
@ -17885,14 +17888,7 @@ again:
|
|||
}
|
||||
UNLOCK_ZONE(zone);
|
||||
|
||||
(void)dns_db_endload(load->db, &load->callbacks);
|
||||
|
||||
LOCK_ZONE(zone);
|
||||
zone_idetach(&load->callbacks.zone);
|
||||
UNLOCK_ZONE(zone);
|
||||
|
||||
load->magic = 0;
|
||||
|
||||
dns_db_detach(&load->db);
|
||||
if (load->zone->lctx != NULL) {
|
||||
dns_loadctx_detach(&load->zone->lctx);
|
||||
|
|
|
|||
Loading…
Reference in a new issue