dsdb/partition: Move in_transaction decrement to end of partition_del_trans()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 16 May 2019 03:12:55 +0000 (15:12 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 20 May 2019 04:01:10 +0000 (04:01 +0000)
It makes no sense for this to be mid-function.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/partition.c

index 49bdeb04fa51d1b20acfa7d5ac91faf648c51c27..dca4b7f7993ce983df9c8f2c68a37eb01fd1b2bd 100644 (file)
@@ -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;
 }