]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: mail_transaction_log_find_file() - remove wrong optimization.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 18 Nov 2016 14:27:33 +0000 (16:27 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 18 Nov 2016 15:04:31 +0000 (17:04 +0200)
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.

src/lib-index/mail-transaction-log.c

index 3e99e96ec0c5244f3ff4f1c809a9f33fd7e213ed..474d07154998a9b0493756db78abf22c92d114ee 100644 (file)
@@ -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;