From 2311d35f84b5e71ec1e19ae9165d6be650e50d37 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Aug 2017 16:22:27 +0200 Subject: [PATCH] gencache: Remove tdb_check from gencache_init() This was legacy from times when we had just one non-transactioned gencache.tdb. With the split into transactioned gencache.tdb and fast, non-transactioned, mutexed clear-if-first gencache_notrans.tdb this has become unnecessary. Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- source3/lib/gencache.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index 1572825f605..24edcc7fc4e 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -74,29 +74,6 @@ static bool gencache_init(void) cache = tdb_wrap_open(NULL, cache_fname, hash_size, TDB_DEFAULT|TDB_INCOMPATIBLE_HASH, open_flags, 0644); - if (cache) { - int ret; - ret = tdb_check(cache->tdb, NULL, NULL); - if (ret != 0) { - TALLOC_FREE(cache); - - /* - * Retry with CLEAR_IF_FIRST. - * - * Warning: Converting this to dbwrap won't work - * directly. gencache.c does transactions on this tdb, - * and dbwrap forbids this for CLEAR_IF_FIRST - * databases. tdb does allow transactions on - * CLEAR_IF_FIRST databases, so lets use it here to - * clean up a broken database. - */ - cache = tdb_wrap_open(NULL, cache_fname, hash_size, - TDB_DEFAULT| - TDB_INCOMPATIBLE_HASH| - TDB_CLEAR_IF_FIRST, - open_flags, 0644); - } - } if (!cache && (errno == EACCES)) { open_flags = O_RDONLY; -- 2.11.4.GIT