The branch, master has been updated
       via  0f5d93a dsdb: Honour LDB_FLG_NOSYNC for metadata.tdb
       via  3c3b1bc pyldb-samba: Use the same smb.conf variable name as the C 
wrapper users for LDB_FLG_NOSYNC
      from  2064401 ctdb-docs: Update reference to lmaster/recmaster capability 
options

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0f5d93a0baa7ef5fc0ef2404dc9a3cc3438d0b7f
Author: Andrew Bartlett <abart...@samba.org>
Date:   Sun Jun 3 18:36:47 2018 +1200

    dsdb: Honour LDB_FLG_NOSYNC for metadata.tdb
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13462
    
    Signed-off-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: Gary Lockyer <g...@catalyst.net.nz>
    
    Autobuild-User(master): Andrew Bartlett <abart...@samba.org>
    Autobuild-Date(master): Mon Jun  4 20:58:01 CEST 2018 on sn-devel-144

commit 3c3b1bc64c642bbb28571621c8ee2e37d8d6556a
Author: Andrew Bartlett <abart...@samba.org>
Date:   Sun Jun 3 18:35:15 2018 +1200

    pyldb-samba: Use the same smb.conf variable name as the C wrapper users for 
LDB_FLG_NOSYNC
    
    This was never noticed as most wrappers on make test run with TDB_NO_FSYNC
    
    However ldb_mdb has not been told to use this (naturally) and so we rely
    on the smb.conf setting to not force an fsync().
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13461
    
    Signed-off-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: Gary Lockyer <g...@catalyst.net.nz>

-----------------------------------------------------------------------

Summary of changes:
 python/samba/__init__.py                            |  2 +-
 source4/dsdb/samdb/ldb_modules/partition_metadata.c | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/__init__.py b/python/samba/__init__.py
index 20c7db2..7b3c653 100644
--- a/python/samba/__init__.py
+++ b/python/samba/__init__.py
@@ -105,7 +105,7 @@ class Ldb(_Ldb):
 
         # Allow admins to force non-sync ldb for all databases
         if lp is not None:
-            nosync_p = lp.get("nosync", "ldb")
+            nosync_p = lp.get("ldb:nosync")
             if nosync_p is not None and nosync_p:
                 flags |= ldb.FLG_NOSYNC
 
diff --git a/source4/dsdb/samdb/ldb_modules/partition_metadata.c 
b/source4/dsdb/samdb/ldb_modules/partition_metadata.c
index d449472..197e7b0 100644
--- a/source4/dsdb/samdb/ldb_modules/partition_metadata.c
+++ b/source4/dsdb/samdb/ldb_modules/partition_metadata.c
@@ -187,7 +187,7 @@ static int partition_metadata_open(struct ldb_module 
*module, bool create)
        struct partition_private_data *data;
        struct loadparm_context *lp_ctx;
        char *filename, *dirname;
-       int open_flags;
+       int open_flags, tdb_flags, ldb_flags;
        struct stat statbuf;
 
        data = talloc_get_type_abort(ldb_module_get_private(module),
@@ -237,9 +237,17 @@ static int partition_metadata_open(struct ldb_module 
*module, bool create)
        lp_ctx = talloc_get_type_abort(ldb_get_opaque(ldb, "loadparm"),
                                       struct loadparm_context);
 
+       tdb_flags = lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT|TDB_SEQNUM);
+
+       ldb_flags = ldb_module_flags(ldb);
+
+       if (ldb_flags & LDB_FLG_NOSYNC) {
+               tdb_flags |= TDB_NOSYNC;
+       }
+
        data->metadata->db = tdb_wrap_open(
                data->metadata, filename, 10,
-               lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT|TDB_SEQNUM), open_flags, 
0660);
+               tdb_flags, open_flags, 0660);
        if (data->metadata->db == NULL) {
                talloc_free(tmp_ctx);
                if (create) {


-- 
Samba Shared Repository

Reply via email to