dovecot: If we couldn't lock dovecot-uidlist, drop our appends s...

dovecot at dovecot.org dovecot at dovecot.org
Sat Sep 22 13:55:42 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/880e1bf0127b
changeset: 6449:880e1bf0127b
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Sep 22 12:53:03 2007 +0300
description:
If we couldn't lock dovecot-uidlist, drop our appends so they don't get
written to transaction log with uid=0.

diffstat:

1 file changed, 6 insertions(+), 1 deletion(-)
src/lib-storage/index/maildir/maildir-save.c |    7 ++++++-

diffs (24 lines):

diff -r bb838223bb93 -r 880e1bf0127b src/lib-storage/index/maildir/maildir-save.c
--- a/src/lib-storage/index/maildir/maildir-save.c	Sat Sep 22 12:51:54 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-save.c	Sat Sep 22 12:53:03 2007 +0300
@@ -572,7 +572,7 @@ int maildir_transaction_save_commit_pre(
 	struct maildir_transaction_context *t =
 		(struct maildir_transaction_context *)ctx->ctx.transaction;
 	struct maildir_filename *mf;
-	uint32_t first_uid, next_uid;
+	uint32_t seq, first_uid, next_uid;
 	enum maildir_uidlist_rec_flag flags;
 	const char *dest;
 	bool newdir, sync_commit = FALSE;
@@ -627,6 +627,11 @@ int maildir_transaction_save_commit_pre(
 		/* this will work even if index isn't updated */
 		*t->ictx.first_saved_uid = first_uid;
 		*t->ictx.last_saved_uid = first_uid + ctx->files_count - 1;
+	} else {
+		/* since we couldn't lock uidlist, we'll have to drop the
+		   appends to index. */
+		for (seq = ctx->seq; seq >= ctx->first_seq; seq--)
+			mail_index_expunge(ctx->trans, seq);
 	}
 
 	/* move them into new/ and/or cur/ */


More information about the dovecot-cvs mailing list