From be204bf4c7712d0f31aac0a7725e54e3a7786507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 2 Nov 2022 13:04:56 +0100 Subject: [PATCH 1/2] Cleanup the dead nodes when pruning the tree While sending the node to prune_tree(), we can also cleanup dead nodes because we already hold the tree and node bucket write locks. --- lib/dns/rbtdb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index f446b822e9..abe0296914 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -2254,6 +2254,12 @@ prune_tree(isc_task_t *task, isc_event_t *event) { decrement_reference(rbtdb, node, 0, &nlocktype, &tlocktype, true); + /* + * We have both write locks, we might as well do a light + * dead nodes cleaning. + */ + cleanup_dead_nodes(rbtdb, locknum); + if (parent != NULL && parent->down == NULL) { /* * node was the only down child of the parent and has From 625c6fd16fc1aa2e84a8197829e3888708b15358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 2 Nov 2022 13:10:42 +0100 Subject: [PATCH 2/2] Add CHANGES for [GL #3641] --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index b32e4583ef..e7aa4be105 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +6012. [func] Cleanup the dead nodes while pruning the tree. + [GL #3641] + 6011. [func] Refactor the privilege setting part of named_os unit to make libcap on Linux mandatory and use setreuid and setregid if available. [GL #3583]