From: Volker Lendecke Date: Wed, 11 Apr 2018 06:01:38 +0000 (+0200) Subject: dbwrap: Fix "use mmap = no" X-Git-Tag: ldb-1.4.0~613 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23d841036d3ba8f2c80bee4edc89049533524e68;p=thirdparty%2Fsamba.git dbwrap: Fix "use mmap = no" Mutexes require mmap. Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Thu Apr 12 23:04:18 CEST 2018 on sn-devel-144 --- diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index a6bf30f0ae7..658ccb602a8 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -111,6 +111,15 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, try_mutex = lp_parm_bool(-1, "dbwrap_tdb_mutexes", "*", try_mutex); try_mutex = lp_parm_bool(-1, "dbwrap_tdb_mutexes", base, try_mutex); + if (!lp_use_mmap()) { + /* + * Mutexes require mmap. "use mmap = no" can + * be a debugging tool, so let it override the + * mutex parameters + */ + try_mutex = false; + } + if (try_mutex && tdb_runtime_check_for_robust_mutexes()) { tdb_flags |= TDB_MUTEX_LOCKING; }