]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fix flushing NFS if minimum wanted transaction log file is lost
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 16 Nov 2016 11:29:49 +0000 (13:29 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 16 Nov 2016 11:29:49 +0000 (13:29 +0200)
src/lib-index/mail-transaction-log-view.c

index b64ace3cd72bcb6ed7f89a54fd9b78974efaa1cc..296098f66d7e040475722070064ac4c8f7ca296d 100644 (file)
@@ -156,9 +156,11 @@ int mail_transaction_log_view_set(struct mail_transaction_log_view *view,
        for (seq = min_file_seq; seq <= max_file_seq; seq++) {
                if (file == NULL || file->hdr.file_seq != seq) {
                        /* see if we could find the missing file. if we know
-                          the max. file sequence, make sure NFS attribute
-                          cache gets flushed if necessary. */
-                       bool nfs_flush = max_file_seq != (uint32_t)-1;
+                          the max. file sequence or we don't have the the min.
+                          file, make sure NFS attribute cache gets flushed if
+                          necessary. */
+                       bool nfs_flush = seq == min_file_seq ||
+                               max_file_seq != (uint32_t)-1;
 
                        ret = mail_transaction_log_find_file(view->log, seq,
                                                             nfs_flush, &file);