From: Howard Chu Date: Mon, 7 Apr 2025 15:46:52 +0000 (+0100) Subject: More for rawpart X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71fe8350561088a3e2f5ed585a924d7326228911;p=thirdparty%2Fopenldap.git More for rawpart It was ignoring the mapsize recorded in the meta page, and was redundantly mapping the meta pages. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index dd00498322..1aa721ba26 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -5373,6 +5373,14 @@ mdb_env_open2(MDB_env *env, int prev) #endif ; + /* if RAWPART, we did a preliminary mapping in read_header. drop it now. */ + if (flags & MDB_RAWPART) { + munmap(env->me_map, env->me_mapsize); + env->me_map = NULL; + /* if mapsize was defaulted, use mapsize from metapage */ + if (env->me_mapsize == DEFAULT_MAPSIZE) + env->me_mapsize = 0; + } /* Was a mapsize configured? */ if (!env->me_mapsize) { env->me_mapsize = meta.mm_mapsize;