[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-sync.c, 1.82, 1.83

cras at dovecot.org cras at dovecot.org
Sun Sep 17 20:28:38 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv2187

Modified Files:
	maildir-sync.c 
Log Message:
maildir_storage_sync_force() crashed if called from mail index sync/expunge
callbacks.



Index: maildir-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-sync.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- maildir-sync.c	10 Sep 2006 12:48:26 -0000	1.82
+++ maildir-sync.c	17 Sep 2006 17:28:36 -0000	1.83
@@ -904,12 +904,18 @@
 	if (ret < 0)
 		mail_index_sync_rollback(&sync_ctx->sync_ctx);
 	else {
+		/* Set syncing_commit=TRUE so that if any sync callbacks try
+		   to access mails which got lost (eg. expunge callback trying
+		   to open the file which was just unlinked) we don't try to
+		   start a second index sync and crash. */
+		mbox->syncing_commit = TRUE;
 		if (mail_index_sync_commit(&sync_ctx->sync_ctx) < 0)
 			ret = -1;
 		else {
 			mbox->ibox.commit_log_file_seq = 0;
 			mbox->ibox.commit_log_file_offset = 0;
 		}
+		mbox->syncing_commit = FALSE;
 	}
 
 	if (ret < 0)



More information about the dovecot-cvs mailing list