From 0121f8c01dcdef0827c8e6a1770d0a5ae3b0806e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 18 Mar 2009 11:21:53 +0000 Subject: [PATCH] More for ITS#5860 --- servers/slapd/back-bdb/cache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index e248ec0fe0..260623cfa8 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -737,6 +737,13 @@ bdb_cache_lru_purge( struct bdb_info *bdb ) /* Free entry for this node if it's present */ if ( elru->bei_e ) { ecount++; + + /* the cache may have gone over the limit while we + * weren't looking, so double check. + */ + if ( !efree && ecount > bdb->bi_cache.c_maxsize ) + efree = bdb->bi_cache.c_minfree; + if ( count < efree ) { elru->bei_e->e_private = NULL; #ifdef SLAP_ZONE_ALLOC -- 2.39.5