mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-26 08:39:00 -04:00
address deadlock introduced in cd2469d3cd
This commit is contained in:
parent
ac564683cf
commit
fd52417f71
1 changed files with 14 additions and 9 deletions
|
|
@ -164,7 +164,7 @@ typedef isc_rwlock_t nodelock_t;
|
|||
#define NODE_LOCK(l, t) RWLOCK((l), (t))
|
||||
#define NODE_UNLOCK(l, t) RWUNLOCK((l), (t))
|
||||
#define NODE_TRYUPGRADE(l) isc_rwlock_tryupgrade(l)
|
||||
#define NODE_DOWNGRADE(l) isc_rwlock_downgrade(l)
|
||||
#define NODE_DOWNGRADE(l) isc_rwlock_downgrade(l)
|
||||
|
||||
/*%
|
||||
* Whether to rate-limit updating the LRU to avoid possible thread contention.
|
||||
|
|
@ -6837,9 +6837,10 @@ subtractrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
* this is deferred until closeversion() is called.
|
||||
*/
|
||||
if (result == ISC_R_SUCCESS && version == NULL && !IS_CACHE(rbtdb)) {
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
iszonesecure(db, rbtdb->current_version, rbtdb->origin_node);
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
version = rbtdb->current_version;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
iszonesecure(db, version, rbtdb->origin_node);
|
||||
}
|
||||
|
||||
return (result);
|
||||
|
|
@ -6895,9 +6896,10 @@ deleterdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
|||
* this is deferred until closeversion() is called.
|
||||
*/
|
||||
if (result == ISC_R_SUCCESS && version == NULL && !IS_CACHE(rbtdb)) {
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
iszonesecure(db, rbtdb->current_version, rbtdb->origin_node);
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
version = rbtdb->current_version;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
iszonesecure(db, version, rbtdb->origin_node);
|
||||
}
|
||||
|
||||
return (result);
|
||||
|
|
@ -7329,9 +7331,12 @@ endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
|||
* zone key, we consider the zone secure.
|
||||
*/
|
||||
if (! IS_CACHE(rbtdb) && rbtdb->origin_node != NULL) {
|
||||
iszonesecure(db, rbtdb->current_version, rbtdb->origin_node);
|
||||
dns_dbversion_t *version = rbtdb->current_version;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
iszonesecure(db, version, rbtdb->origin_node);
|
||||
} else {
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
}
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
|
||||
callbacks->add = NULL;
|
||||
callbacks->add_private = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue