From: Garming Sam Date: Wed, 7 Feb 2018 10:21:45 +0000 (+1300) Subject: partition: Leave metadata.tdb unlocking until last X-Git-Tag: talloc-2.1.12~263 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=242cf337e9e9d72f8c919d0772fd5e35fb2422dc;p=thirdparty%2Fsamba.git partition: Leave metadata.tdb unlocking until last With the lmdb patches, I have cleanly observed the database being read in between the commit of the metadata.tdb and the eventual commits of the individual partitions. Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 2cb05f9ef3a..422ed369ff5 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -976,10 +976,6 @@ int partition_end_trans(struct ldb_module *module) data->in_transaction--; } - ret2 = partition_metadata_end_trans(module); - if (ret2 != LDB_SUCCESS) { - ret = ret2; - } for (i=0; data && data->partitions && data->partitions[i]; i++) { if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) { @@ -1002,6 +998,12 @@ int partition_end_trans(struct ldb_module *module) if (ret2 != LDB_SUCCESS) { ret = ret2; } + + ret2 = partition_metadata_end_trans(module); + if (ret2 != LDB_SUCCESS) { + ret = ret2; + } + return ret; } @@ -1012,10 +1014,6 @@ int partition_del_trans(struct ldb_module *module) unsigned int i; struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module), struct partition_private_data); - ret = partition_metadata_del_trans(module); - if (ret != LDB_SUCCESS) { - final_ret = ret; - } for (i=0; data && data->partitions && data->partitions[i]; i++) { if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) { @@ -1044,6 +1042,12 @@ int partition_del_trans(struct ldb_module *module) if (ret != LDB_SUCCESS) { final_ret = ret; } + + ret = partition_metadata_del_trans(module); + if (ret != LDB_SUCCESS) { + final_ret = ret; + } + return final_ret; }