ldb: Lock the whole backend database for the duration of a search
authorAndrew Bartlett <abartlet@samba.org>
Thu, 15 Jun 2017 01:56:46 +0000 (13:56 +1200)
committerStefan Metzmacher <metze@samba.org>
Sun, 2 Jul 2017 15:35:19 +0000 (17:35 +0200)
commita8958515f0340d42e64837fcdf5823f04f6f2544
tree4bc2b2d204ec49c2dbdb2824492859cb292467b4
parentd3c0df35c9af535148b91f87de75aaf4c2e57b71
ldb: Lock the whole backend database for the duration of a search

We must hold locks not just for the duration of each search, but for the whole search
as our module stack may make multiple search requests to build up the whole result.

This is explains a number of replication and read corruption issues in Samba

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/ldb/common/ldb.c
lib/ldb/tests/ldb_mod_op_test.c