From 00e2d83fa4f1e9a336c2030a3f07066caee85083 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 20 Nov 2012 10:02:07 +0100 Subject: [PATCH] s3: Open gencache_notrans with TDB_NOSYNC We are doing CLEAR_IF_FIRST here, and we are doing the transactions only to protect gencache_stabilize against concurrent writers. tdb's transaction.c says: - if TDB_NOSYNC is passed to flags in tdb_open then transactions are still available, but no fsync/msync calls are made. This means we are still proof against a process dying during transaction commit, but not against machine reboot. For gencache_notrans.tdb this is exactly what we want and avoids some expensive disk syncs. Reviewed by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Nov 28 03:13:56 CET 2012 on sn-devel-104 --- source3/lib/gencache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index a64677d2bfe..0b24c0c1e78 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -106,7 +106,10 @@ again: DEBUG(5, ("Opening cache file at %s\n", cache_fname)); - cache_notrans = tdb_open_log(cache_fname, 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, + cache_notrans = tdb_open_log(cache_fname, 0, + TDB_CLEAR_IF_FIRST| + TDB_INCOMPATIBLE_HASH| + TDB_NOSYNC, open_flags, 0644); if (cache_notrans == NULL) { DEBUG(5, ("Opening %s failed: %s\n", cache_fname, -- 2.34.1