]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
release RCU in dns_qpmulti_snapshot()
authorEvan Hunt <each@isc.org>
Tue, 28 Nov 2023 23:05:55 +0000 (15:05 -0800)
committerEvan Hunt <each@isc.org>
Fri, 8 Mar 2024 23:36:56 +0000 (15:36 -0800)
previously, an RCU critical section was held open for the duration
of a snapshot. this should not be necessary, as the snapshot makes
local copies of QP trie metadata, and it causes problems when a
DB iterator is held open between two loop events.  we now call
rcu_read_unlock() after setting up the snapshot.

lib/dns/qp.c

index 4ea05e09683f21d6190b5e9b0b591e3d8df48c3d..4e70fa0dac485a483700209357186430945c58e3 100644 (file)
@@ -1391,6 +1391,8 @@ dns_qpmulti_snapshot(dns_qpmulti_t *multi, dns_qpsnap_t **qpsp) {
 
        *qpsp = qps;
        UNLOCK(&multi->mutex);
+
+       rcu_read_unlock();
 }
 
 void
@@ -1417,8 +1419,6 @@ dns_qpsnap_destroy(dns_qpmulti_t *multi, dns_qpsnap_t **qpsp) {
 
        *qpsp = NULL;
        UNLOCK(&multi->mutex);
-
-       rcu_read_unlock();
 }
 
 /***********************************************************************