[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-sync.c, 1.37, 1.38

cras at dovecot.org cras at dovecot.org
Fri Jul 30 08:08:38 EEST 2004


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

Modified Files:
	maildir-sync.c 
Log Message:
Renamed mail_index_sync_end() to _commit() and added _rollback(). Fixed mbox
deadlocking issue.



Index: maildir-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-sync.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- maildir-sync.c	26 Jul 2004 18:52:07 -0000	1.37
+++ maildir-sync.c	30 Jul 2004 05:08:35 -0000	1.38
@@ -350,7 +350,7 @@
 		}
 		if (mail_index_transaction_commit(ctx.trans, &seq, &offset) < 0)
 			ret = -1;
-		if (mail_index_sync_end(ctx.sync_ctx) < 0)
+		if (mail_index_sync_commit(ctx.sync_ctx) < 0)
 			ret = -1;
 	}
         ibox->syncing_commit = FALSE;
@@ -612,7 +612,7 @@
 			"Maildir %s sync: UIDVALIDITY changed (%u -> %u)",
 			ibox->path, hdr->uid_validity, uid_validity);
 		mail_index_mark_corrupted(ibox->index);
-		(void)mail_index_sync_end(sync_ctx.sync_ctx);
+		(void)mail_index_sync_rollback(sync_ctx.sync_ctx);
 		return -1;
 	}
 
@@ -815,9 +815,10 @@
 			&next_uid, sizeof(next_uid));
 	}
 
-	if (ret < 0)
+	if (ret < 0) {
 		mail_index_transaction_rollback(trans);
-	else {
+		mail_index_sync_rollback(sync_ctx.sync_ctx);
+	} else {
 		uint32_t seq;
 		uoff_t offset;
 
@@ -827,11 +828,10 @@
 			ibox->commit_log_file_seq = seq;
 			ibox->commit_log_file_offset = offset;
 		}
+		if (mail_index_sync_commit(sync_ctx.sync_ctx) < 0)
+			ret = -1;
 	}
 
-	if (mail_index_sync_end(sync_ctx.sync_ctx) < 0)
-		ret = -1;
-
 	if (ret == 0) {
 		ibox->commit_log_file_seq = 0;
 		ibox->commit_log_file_offset = 0;



More information about the dovecot-cvs mailing list