]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gencache: Remove tdb_check from gencache_init()
authorVolker Lendecke <vl@samba.org>
Wed, 16 Aug 2017 14:22:27 +0000 (16:22 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 17 Aug 2017 09:54:10 +0000 (11:54 +0200)
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 <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/lib/gencache.c

index 1572825f605311ce468c1daff75a8ee3e324b17b..24edcc7fc4e8bd26f78a129b657cfeb30677e795 100644 (file)
@@ -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;