From 93e5705259d4ebc4131b46ffee4e68163d171f04 Mon Sep 17 00:00:00 2001 From: xiangbao227 <1004129700@qq.com> Date: Wed, 13 Jan 2021 10:33:41 +0800 Subject: [PATCH] I found that in function lruhash_remove, table was locked at first ,then lru_remove the entry , then unlock the table, and then markdel entry , but in function rrset_cache_touch , the entry will be touched to lru again before markdelling entry in function lruhash_remove. This is a bug! --- util/storage/lruhash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/storage/lruhash.c b/util/storage/lruhash.c index 0003ff491..3500a4ef0 100644 --- a/util/storage/lruhash.c +++ b/util/storage/lruhash.c @@ -398,13 +398,13 @@ lruhash_remove(struct lruhash* table, hashvalue_type hash, void* key) return; } table->num--; - table->space_used -= (*table->sizefunc)(entry->key, entry->data); - lock_quick_unlock(&table->lock); + table->space_used -= (*table->sizefunc)(entry->key, entry->data); lock_rw_wrlock(&entry->lock); if(table->markdelfunc) (*table->markdelfunc)(entry->key); lock_rw_unlock(&entry->lock); lock_quick_unlock(&bin->lock); + lock_quick_unlock(&table->lock); /* finish removal */ d = entry->data; (*table->delkeyfunc)(entry->key, table->cb_arg); -- 2.47.2