summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2017-03-30 12:03:17 +1300
committerStefan Metzmacher <metze@samba.org>2017-07-02 17:35:19 +0200
commit289d7d8fc5c2fcc004eeb0f0e4ce475c33e3952e (patch)
tree64dff134881ac0788c79e39c24181b02e8190878 /lib
parent25e580f86e82c41a9380e42ad16d94053abaa8d4 (diff)
downloadsamba-289d7d8fc5c2fcc004eeb0f0e4ce475c33e3952e.tar.gz
ldb:tdb: Ensure we correctly decrement ltdb->read_lock_count
If we do not do this, then we never take the all record lock, and instead do a lock for every record as we go, which is very slow during a large search Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/ldb_tdb/ldb_tdb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index f470e023d19..ad15a5e70a5 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -119,6 +119,7 @@ int ltdb_unlock_read(struct ldb_module *module)
struct ltdb_private *ltdb = talloc_get_type(data, struct ltdb_private);
if (ltdb->in_transaction == 0 && ltdb->read_lock_count == 1) {
tdb_unlockall_read(ltdb->tdb);
+ ltdb->read_lock_count--;
return 0;
}
ltdb->read_lock_count--;