]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Don't update log_file_tail_offset on sync if reading dovecot.index.log...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 5 Feb 2023 18:50:06 +0000 (20:50 +0200)
committermarkus.valentin <markus.valentin@open-xchange.com>
Tue, 28 Feb 2023 12:09:54 +0000 (12:09 +0000)
This is more of a theoretical issue, since dovecot.index.log read failure is
very unlikely.

src/lib-index/mail-index-sync-update.c

index c1dfe1c36f562bca7eb2d7ea1d014252a808113c..7fb1846c3cf2a9c2757c5490953f69884f60fe74 100644 (file)
@@ -1048,7 +1048,8 @@ int mail_index_sync_map(struct mail_index_map **_map,
           over following external transactions to avoid extra unneeded log
           reading. */
        i_assert(map->hdr.log_file_seq == index->log->head->hdr.file_seq);
-       if (map->hdr.log_file_tail_offset < index->log->head->max_tail_offset) {
+       if (ret == 0 &&
+           map->hdr.log_file_tail_offset < index->log->head->max_tail_offset) {
                map->hdr.log_file_tail_offset =
                        index->log->head->max_tail_offset;
        }