1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

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 <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Garming Sam 2018-02-07 23:21:45 +13:00 committed by Andrew Bartlett
parent 8caf84a8d4
commit 242cf337e9

View File

@ -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;
}