Commit f34bab41 authored by Evan Hunt's avatar Evan Hunt

Merge branch 'each-lmdb-lock-fix-v9_11' into 'v9_11'

ensure new_zone_lock is released after count_newzones()

See merge request !3846
parents 2120268f 0f7f6201
Pipeline #46686 passed with stages
in 3 minutes and 30 seconds
......@@ -6789,6 +6789,8 @@ count_newzones(dns_view_t *view, ns_cfgctx_t *nzcfg, int *num_zonesp) {
REQUIRE(num_zonesp != NULL);
LOCK(&view->new_zone_lock);
CHECK(migrate_nzf(view));
isc_log_write(ns_g_lctx,
......@@ -6797,8 +6799,6 @@ count_newzones(dns_view_t *view, ns_cfgctx_t *nzcfg, int *num_zonesp) {
"for view '%s'",
view->new_zone_db, view->name);
LOCK(&view->new_zone_lock);
CHECK(nzd_count(view, &n));
*num_zonesp = n;
......@@ -12006,6 +12006,10 @@ nzd_count(dns_view_t *view, int *countp) {
return (result);
}
/*
* Migrate zone configuration from an NZF file to an NZD database.
* Caller must hold view->new_zone_lock.
*/
static isc_result_t
migrate_nzf(dns_view_t *view) {
isc_result_t result;
......@@ -12021,8 +12025,6 @@ migrate_nzf(dns_view_t *view) {
MDB_val key, data;
ns_dzarg_t dzarg;
LOCK(&view->new_zone_lock);
/*
* If NZF file doesn't exist, or NZD DB exists and already
* has data, return without attempting migration.
......@@ -12166,8 +12168,6 @@ migrate_nzf(dns_view_t *view) {
result = nzd_close(&txn, commit);
}
UNLOCK(&view->new_zone_lock);
if (text != NULL) {
isc_buffer_free(&text);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment