[dovecot-cvs] dovecot/src/lib-index mail-cache-transaction.c, 1.46, 1.47

cras at dovecot.org cras at dovecot.org
Mon Jan 2 15:08:00 EET 2006


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv12094

Modified Files:
	mail-cache-transaction.c 
Log Message:
Don't fdatasync() cache file. It's not all that important.



Index: mail-cache-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-transaction.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- mail-cache-transaction.c	28 Oct 2005 10:52:02 -0000	1.46
+++ mail-cache-transaction.c	2 Jan 2006 13:07:57 -0000	1.47
@@ -568,11 +568,10 @@
 	if (mail_cache_transaction_flush(ctx) < 0)
 		ret = -1;
 
-	/* make sure everything's written before updating offsets */
-	if (fdatasync(cache->fd) < 0) {
-		mail_cache_set_syscall_error(cache, "fdatasync()");
-		ret = -1;
-	}
+	/* Here would be a good place to do fdatasync() to make sure
+	   everything is written before offsets are updated to index.
+	   However it slows down I/O unneededly and we're pretty good at
+	   catching and fixing cache corruption, so we no longer do it. */
 
 	if (mail_cache_unlock(cache) < 0)
 		ret = -1;



More information about the dovecot-cvs mailing list