From: Volker Lendecke Date: Thu, 25 Oct 2018 13:55:29 +0000 (+0200) Subject: tdb: Purge dead records whenever we block the freelist X-Git-Tag: tdb-1.3.17~1128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ed2a67a59d826292e7d4d6991942b4cc15d72dc;p=thirdparty%2Fsamba.git tdb: Purge dead records whenever we block the freelist Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/lib/tdb/common/freelist.c b/lib/tdb/common/freelist.c index 5afd89bc554..5221bf3679e 100644 --- a/lib/tdb/common/freelist.c +++ b/lib/tdb/common/freelist.c @@ -619,6 +619,12 @@ blocking_freelist_allocate: if (tdb_lock(tdb, -1, F_WRLCK) == -1) { return 0; } + /* + * Dead records can happen even if max_dead_records==0, they + * are older than the max_dead_records concept: They happen if + * tdb_delete happens concurrently with a traverse. + */ + tdb_purge_dead(tdb, hash); ret = tdb_allocate_from_freelist(tdb, length, rec); tdb_unlock(tdb, -1, F_WRLCK); return ret;