From: Timo Sirainen Date: Tue, 1 Oct 2019 15:54:31 +0000 (+0300) Subject: lib-index: Change mail_transaction_log_file.need_rotate into a string X-Git-Tag: 2.3.11.2~519 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec7a6682eaebaac2190a23b417631d214264ba13;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Change mail_transaction_log_file.need_rotate into a string The string specifies the reason why the rotation is wanted. --- diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index 220659af82..bf841a192b 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -127,6 +127,7 @@ void mail_transaction_log_file_free(struct mail_transaction_log_file **_file) } i_free(file->filepath); + i_free(file->need_rotate); i_free(file); errno = old_errno; @@ -1351,7 +1352,10 @@ int mail_transaction_log_file_get_modseq_next_offset( i_assert(ret != 0); /* get it fixed on the next sync */ file->log->index->need_recreate = TRUE; - file->need_rotate = TRUE; + if (file->need_rotate == NULL) { + file->need_rotate = + i_strdup("modseq tracking is corrupted"); + } /* clear cache, since it's unreliable */ memset(file->modseq_cache, 0, sizeof(file->modseq_cache)); } diff --git a/src/lib-index/mail-transaction-log-private.h b/src/lib-index/mail-transaction-log-private.h index c313723957..79e800fda4 100644 --- a/src/lib-index/mail-transaction-log-private.h +++ b/src/lib-index/mail-transaction-log-private.h @@ -37,6 +37,7 @@ struct mail_transaction_log_file { uoff_t last_size; time_t last_mmap_error_time; + char *need_rotate; struct mail_transaction_log_header hdr; buffer_t mmap_buffer; @@ -71,7 +72,6 @@ struct mail_transaction_log_file { bool locked:1; bool locked_sync_offset_updated:1; bool corrupted:1; - bool need_rotate:1; }; struct mail_transaction_log {