[dovecot-cvs] dovecot/src/lib-index mail-index-sync-ext.c, 1.17, 1.18

cras at dovecot.org cras at dovecot.org
Tue May 30 11:34:31 EEST 2006


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

Modified Files:
	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.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- mail-index-sync-ext.c	30 May 2006 08:31:20 -0000	1.17
+++ mail-index-sync-ext.c	30 May 2006 08:34:23 -0000	1.18
@@ -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