[dovecot-cvs] dovecot/src/lib-index mail-index-sync-ext.c, 1.16.2.1, 1.16.2.2

cras at dovecot.org cras at dovecot.org
Sun May 28 23:03:09 EEST 2006


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

Modified Files:
      Tag: branch_1_0
	mail-index-sync-ext.c 
Log Message:
When extension data is being reset, recreate the index file to make sure
that other processes notice the reset_id change. Fixes cache file corruption
complaints around the time it's being compressed.



Index: mail-index-sync-ext.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-ext.c,v
retrieving revision 1.16.2.1
retrieving revision 1.16.2.2
diff -u -d -r1.16.2.1 -r1.16.2.2
--- mail-index-sync-ext.c	18 May 2006 10:08:55 -0000	1.16.2.1
+++ mail-index-sync-ext.c	28 May 2006 20:03:07 -0000	1.16.2.2
@@ -461,6 +461,13 @@
 	if (ctx->cur_ext_ignore)
 		return 1;
 
+	if (!map->write_to_disk || map->refcount != 1) {
+		/* a new index file will be created, so the old data won't be
+		   accidentally used by other processes. */
+		map = mail_index_map_clone(map, map->hdr.record_size);
+		mail_index_sync_replace_map(ctx, map);
+	}
+
 	ext = array_idx_modifyable(&map->extensions, ctx->cur_ext_id);
 	ext->reset_id = u->new_reset_id;
 



More information about the dovecot-cvs mailing list