From: Howard Chu Date: Wed, 9 Jul 2014 13:54:32 +0000 (-0700) Subject: ITS#7789 more X-Git-Tag: OPENLDAP_REL_ENG_2_4_40~126^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=38e71c68de2ad61fb0fd72fd40214fd9a94479b9;p=openldap ITS#7789 more persist size changes from env_open() as well. This was the original behavior. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index d6ad1142b1..c2f2c7439b 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3791,13 +3791,17 @@ mdb_env_open2(MDB_env *env) * else use the size recorded in the existing env. */ env->me_mapsize = newenv ? DEFAULT_MAPSIZE : meta.mm_mapsize; - } else if (env->me_mapsize < meta.mm_mapsize) { - /* If the configured size is smaller, make sure it's - * still big enough. Silently round up to minimum if not. - */ - size_t minsize = (meta.mm_last_pg + 1) * meta.mm_psize; - if (env->me_mapsize < minsize) - env->me_mapsize = minsize; + } else { + if (env->me_mapsize < meta.mm_mapsize) { + /* If the configured size is smaller, make sure it's + * still big enough. Silently round up to minimum if not. + */ + size_t minsize = (meta.mm_last_pg + 1) * meta.mm_psize; + if (env->me_mapsize < minsize) + env->me_mapsize = minsize; + } + if (env->me_mapsize != meta.mm_mapsize) + env->me_flags |= MDB_RESIZING; } rc = mdb_env_map(env, meta.mm_address, newenv || env->me_mapsize != meta.mm_mapsize);