From 063a4a82f68f7dcfbd8df3ecb9290a0185076995 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Fri, 9 Apr 1999 19:25:55 +0000 Subject: [PATCH] Since rollback_node() no longer frees rdatasets, we must mark the node as dirty if anything was rolled back, because otherwise the node cleaning routine will not run when the node reference count becomes 0. --- lib/dns/rbtdb.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index d7f9328309..b18e571f2d 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -439,6 +439,7 @@ free_rdataset(isc_mem_t *mctx, rdatasetheader_t *rdataset) { static inline void rollback_node(dns_rbtnode_t *node, rbtdb_serial_t serial) { rdatasetheader_t *header, *dcurrent; + isc_boolean_t make_dirty = ISC_FALSE; /* * Caller must hold the node lock. @@ -450,15 +451,21 @@ rollback_node(dns_rbtnode_t *node, rbtdb_serial_t serial) { * will be cleaned up; until that time, they will be ignored. */ for (header = node->data; header != NULL; header = header->next) { - if (header->serial == serial) + if (header->serial == serial) { header->attributes |= RDATASET_ATTR_IGNORE; + make_dirty = ISC_TRUE; + } for (dcurrent = header->down; dcurrent != NULL; dcurrent = dcurrent->down) { - if (dcurrent->serial == serial) + if (dcurrent->serial == serial) { dcurrent->attributes |= RDATASET_ATTR_IGNORE; + make_dirty = ISC_TRUE; + } } } + if (make_dirty) + node->dirty = 1; } static inline void