mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch '4070-tsan-qpmulti-destroy' into 'main'
Acquire qpmulti->mutex during destruction Closes #4070 and #4073 See merge request isc-projects/bind9!7938
This commit is contained in:
commit
845fa7a849
2 changed files with 11 additions and 3 deletions
|
|
@ -3,5 +3,5 @@ called_from_lib:libfstrm.so
|
|||
called_from_lib:libdummyrpz.so
|
||||
# be more selective with liburcu
|
||||
race:rcu_barrier
|
||||
race:rcu_memb_barrier
|
||||
race:rcu_*_barrier
|
||||
thread:*
|
||||
|
|
|
|||
12
lib/dns/qp.c
12
lib/dns/qp.c
|
|
@ -1431,14 +1431,22 @@ static void
|
|||
qpmulti_destroy_cb(struct rcu_head *arg) {
|
||||
qp_rcuctx_t *rcuctx = isc_urcu_container(arg, qp_rcuctx_t, rcu_head);
|
||||
REQUIRE(QPRCU_VALID(rcuctx));
|
||||
/* only nonzero for reclaim_chunks_cb() */
|
||||
REQUIRE(rcuctx->count == 0);
|
||||
|
||||
dns_qpmulti_t *multi = rcuctx->multi;
|
||||
REQUIRE(QPMULTI_VALID(multi));
|
||||
|
||||
/* reassure thread sanitizer */
|
||||
LOCK(&multi->mutex);
|
||||
|
||||
dns_qp_t *qp = &multi->writer;
|
||||
REQUIRE(QP_VALID(qp));
|
||||
|
||||
REQUIRE(rcuctx->count == 0);
|
||||
|
||||
destroy_guts(qp);
|
||||
|
||||
UNLOCK(&multi->mutex);
|
||||
|
||||
isc_mutex_destroy(&multi->mutex);
|
||||
isc_mem_putanddetach(&rcuctx->mctx, rcuctx,
|
||||
STRUCT_FLEX_SIZE(rcuctx, chunk, rcuctx->count));
|
||||
|
|
|
|||
Loading…
Reference in a new issue