From: Howard Chu Date: Wed, 18 Mar 2009 11:21:53 +0000 (+0000) Subject: More for ITS#5860 X-Git-Tag: ACLCHECK_0~668 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0121f8c01dcdef0827c8e6a1770d0a5ae3b0806e;p=openldap More for ITS#5860 --- 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