dovecot: Don't update log_file_tail_offset in header until synci...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jun 16 01:10:48 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/a380a5dc9307
changeset: 5755:a380a5dc9307
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jun 16 01:10:44 2007 +0300
description:
Don't update log_file_tail_offset in header until syncing is finished.

diffstat:

1 file changed, 6 insertions(+)
src/lib-index/mail-index-sync-update.c |    6 ++++++

diffs (23 lines):

diff -r 0096aaf83731 -r a380a5dc9307 src/lib-index/mail-index-sync-update.c
--- a/src/lib-index/mail-index-sync-update.c	Sat Jun 16 01:09:26 2007 +0300
+++ b/src/lib-index/mail-index-sync-update.c	Sat Jun 16 01:10:44 2007 +0300
@@ -435,6 +435,7 @@ static int sync_header_update(const stru
 			      struct mail_index_sync_map_ctx *ctx)
 {
 	struct mail_index_map *map = ctx->view->map;
+	uint32_t orig_log_file_tail_offset = map->hdr.log_file_tail_offset;
 
 	if (u->offset >= map->hdr.base_header_size ||
 	    u->offset + u->size > map->hdr.base_header_size) {
@@ -456,6 +457,11 @@ static int sync_header_update(const stru
 		memcpy(PTR_OFFSET(&map->hdr, u->offset),
 		       u + 1, sizeof(map->hdr) - u->offset);
 	}
+
+	/* the tail offset updates are intended for internal transaction
+	   log handling. we'll update the offset in the header only when
+	   the sync is finished. */
+	map->hdr.log_file_tail_offset = orig_log_file_tail_offset;
 	return 1;
 }
 


More information about the dovecot-cvs mailing list