]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Maildir: If uidlist couldn't be locked while saving, we might have assert-crashed
authorTimo Sirainen <tss@iki.fi>
Sun, 20 Jul 2008 17:17:46 +0000 (20:17 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 20 Jul 2008 17:17:46 +0000 (20:17 +0300)
afterwards when trying to update cache file for the newly saved message
whose index update was already cancelled.

--HG--
branch : HEAD

src/lib-storage/index/index-mail.c

index 2423eccbf4be23893c990a89b6a51ab91e89aa74..318cec206e14d409d742b06a73c95295140d428b 100644 (file)
@@ -1082,7 +1082,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);
        }