dovecot-2.2: mdbox: When purging writes new data, flush them to ...

dovecot at dovecot.org dovecot at dovecot.org
Fri Dec 20 19:59:34 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/e322c40a82a9
changeset: 17087:e322c40a82a9
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Dec 20 19:59:22 2013 +0200
description:
mdbox: When purging writes new data, flush them to disk before locking the map index.

diffstat:

 src/lib-storage/index/dbox-multi/mdbox-purge.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r bfee9f413844 -r e322c40a82a9 src/lib-storage/index/dbox-multi/mdbox-purge.c
--- a/src/lib-storage/index/dbox-multi/mdbox-purge.c	Fri Dec 20 04:57:25 2013 +0200
+++ b/src/lib-storage/index/dbox-multi/mdbox-purge.c	Fri Dec 20 19:59:22 2013 +0200
@@ -383,6 +383,11 @@
 			"(%"PRIuUOFF_T" < %"PRIuUOFF_T")", offset, st.st_size);
 		ret = 0;
 	}
+	if (ret > 0 && ctx->append_ctx != NULL) {
+		/* flush writes before locking the map */
+		if (mdbox_map_append_flush(ctx->append_ctx) < 0)
+			ret = -1;
+	}
 
 	if (ret <= 0)
 		ret = -1;


More information about the dovecot-cvs mailing list