tdb: Fix bug 11381, deadlock
authorVolker Lendecke <vl@samba.org>
Mon, 6 Jul 2015 11:13:36 +0000 (13:13 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 12 Oct 2015 19:37:20 +0000 (21:37 +0200)
commit95b17d59d16c119bcc674decf176ab583bb5ce2a
tree52f6cc8b537700abf21891d6d3b7fad0690d048c
parent0349f95f2fa2616f4f8c2e141c54f0e4583b5499
tdb: Fix bug 11381, deadlock

This fixes a deadlock in tdb that is a bad interaction between tdb_lockall
and tdb_traverse. This deadlock condition has been around even before
tdb mutexes, it's just that the kernel fcntl EDEADLK detection protected
us from this ABBA lock condition to become a real deadlock stalling
processes. With tdb mutexes, this deadlock protection is gone, so we do
lock dead.

This patch glosses over this particular ABBA condition, making tdb with
mutexes behave the same as tdb without mutexes. Admittedly this is no
real fix, but it works around a real user's problem.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11381
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 1061a9cafda7d73ebcd2f74e69e74f4adc485d5d)
lib/tdb/common/traverse.c