dovecot-1.1: Maildir: If uidlist couldn't be locked while saving...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jul 20 20:17:50 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/65d1fc48224d
changeset: 7770:65d1fc48224d
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jul 20 20:17:46 2008 +0300
description:
Maildir: If uidlist couldn't be locked while saving, we might have assert-crashed
afterwards when trying to update cache file for the newly saved message
whose index update was already cancelled.

diffstat:

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

diffs (17 lines):

diff -r b7ebe46cf4a6 -r 65d1fc48224d src/lib-storage/index/index-mail.c
--- a/src/lib-storage/index/index-mail.c	Sun Jul 20 19:45:39 2008 +0300
+++ b/src/lib-storage/index/index-mail.c	Sun Jul 20 20:17:46 2008 +0300
@@ -1062,7 +1062,12 @@ void index_mail_close(struct mail *_mail
 	struct index_mail *mail = (struct index_mail *)_mail;
 	struct message_part *parts;
 
-	if (mail->mail.mail.seq != 0) {
+	/* If uid == 0 but seq != 0, we came here from saving a (non-mbox)
+	   message. If that happens, don't bother checking if anything should
+	   be cached since it was already checked. Also by now the transaction
+	   may have already been rollbacked and seq point to a non-existing
+	   message. */
+	if (mail->mail.mail.uid != 0) {
 		index_mail_cache_sizes(mail);
 		index_mail_cache_dates(mail);
 	}


More information about the dovecot-cvs mailing list