'use mmap = no' option doesn't work anymore
Volker Lendecke
Volker.Lendecke at SerNet.DE
Wed Apr 11 06:03:07 UTC 2018
On Wed, Apr 11, 2018 at 10:20:05AM +1200, Garming Sam via samba-technical wrote:
> I think it's because of this patch, which Ralph put in.
>
> dbwrap: enable mutexes by default for volatile TDBs
>
> Bug: https://bugzilla.samba.org/show_bug.cgi?id=12891
>
> a70be43246ab74f0a2bbe245ab31f24460b70547
>
> TDB_MUTEX_LOCKING and TDB_NOMMAP are mutually exclusive and so it bails out.
So the attached patch should fix it. Can you try that?
Thanks, Volker
--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 9da3ff38d92c6209fc914b928661ac3d43338257 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 11 Apr 2018 08:01:38 +0200
Subject: [PATCH] dbwrap: Fix "use mmap = no"
Mutexes require mmap.
Signed-off-by: Volker Lendecke <vl at samba.org>
---
source3/lib/dbwrap/dbwrap_open.c | 9 +++++++++
1 file changed, 9 insertions(+)
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;
}
--
2.11.0
More information about the samba-technical
mailing list