]> 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)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 15 Jun 2023 17:21:25 +0000 (17:21 +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 0c3799564339cc8df8df75369dfa278719d81882..8c3b56d7596b2b6bb1b6a274a80cbef6c778d59d 100644 (file)
@@ -1051,7 +1051,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;
        }