From: Timo Sirainen Date: Fri, 18 Nov 2016 14:27:33 +0000 (+0200) Subject: lib-index: mail_transaction_log_find_file() - remove wrong optimization. X-Git-Tag: 2.2.27~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e290d2778c736b68af0a81d084cd9b10448d064;p=thirdparty%2Fdovecot%2Fcore.git lib-index: mail_transaction_log_find_file() - remove wrong optimization. When opening the index, it's possible that: process A: .log is opened with seq=1 process B: Rotates the .log and writes a new dovecot.index with log_file_seq=2 process A: dovecot.index is opened. mail_transaction_log_view_set() now wants to file log_file_seq=2 with mail_transaction_log_find_file(), but because open_count==0, the .log isn't refreshed. --- diff --git a/src/lib-index/mail-transaction-log.c b/src/lib-index/mail-transaction-log.c index 3e99e96ec0..474d071549 100644 --- a/src/lib-index/mail-transaction-log.c +++ b/src/lib-index/mail-transaction-log.c @@ -376,12 +376,6 @@ int mail_transaction_log_find_file(struct mail_transaction_log *log, file exists. */ return 0; } - if (log->index->open_count == 0) { - /* we're opening the index and we just opened the - log file. don't waste time checking if there's a - newer one. */ - return 0; - } if (mail_transaction_log_refresh(log, FALSE) < 0) return -1;