From: Andrew Bartlett Date: Thu, 16 May 2019 03:12:55 +0000 (+1200) Subject: dsdb/partition: Move in_transaction decrement to end of partition_del_trans() X-Git-Tag: ldb-2.0.5~760 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc663a979837f84fbd6d5f3bed1444d170ce7abb;p=thirdparty%2Fsamba.git dsdb/partition: Move in_transaction decrement to end of partition_del_trans() It makes no sense for this to be mid-function. Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 49bdeb04fa5..dca4b7f7993 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -1193,12 +1193,6 @@ int partition_del_trans(struct ldb_module *module) } } - if (data->in_transaction == 0) { - DEBUG(0,("partition del transaction mismatch\n")); - return ldb_operr(ldb_module_get_ctx(module)); - } - data->in_transaction--; - if (ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING) { ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_del_trans() -> (metadata partition)"); @@ -1213,6 +1207,12 @@ int partition_del_trans(struct ldb_module *module) final_ret = ret; } + if (data->in_transaction == 0) { + DEBUG(0,("partition del transaction mismatch\n")); + return ldb_operr(ldb_module_get_ctx(module)); + } + data->in_transaction--; + return final_ret; }