]> git.sur5r.net Git - openldap/commitdiff
More for ITS#5860
authorHoward Chu <hyc@openldap.org>
Wed, 18 Mar 2009 11:21:53 +0000 (11:21 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 18 Mar 2009 11:21:53 +0000 (11:21 +0000)
servers/slapd/back-bdb/cache.c

index e248ec0fe028906f1ff703daf2cf365858335bf2..260623cfa82ff4bef803c33abf572885b67e5ff1 100644 (file)
@@ -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