dovecot-2.1: file-dotlock: Avoid "timestamp is different than cu...

dovecot at dovecot.org dovecot at dovecot.org
Tue Feb 21 11:08:17 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/2ea29ab6f10f
changeset: 14177:2ea29ab6f10f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Feb 21 11:08:05 2012 +0200
description:
file-dotlock: Avoid "timestamp is different than current time" errors during high disk I/O load.

diffstat:

 src/lib/file-dotlock.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r 7d0d76df719f -r 2ea29ab6f10f src/lib/file-dotlock.c
--- a/src/lib/file-dotlock.c	Tue Feb 21 03:07:49 2012 +0200
+++ b/src/lib/file-dotlock.c	Tue Feb 21 11:08:05 2012 +0200
@@ -534,8 +534,13 @@
 				try_create_lock_excl(&lock_info, write_pid) :
 				try_create_lock_hardlink(&lock_info, write_pid,
 							 tmp_path, now);
-			if (ret != 0)
+			if (ret != 0) {
+				/* if we succeeded, get the current time once
+				   more in case disk I/O usage was really high
+				   and it took a long time to create the lock */
+				now = time(NULL);
 				break;
+			}
 		}
 
 		if (last_notify != now && set->callback != NULL) {


More information about the dovecot-cvs mailing list