]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Do update log_file_tail_offset on sync if mail_transaction_log_view_next...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 12 Feb 2024 08:26:43 +0000 (10:26 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 20 Oct 2025 05:53:35 +0000 (05:53 +0000)
The previous change assumed that mail_transaction_log_view_next() would
return -1 on read() error. However, it's actually returning -1 to indicate
a corrupted record.

Reverts aae93d3ea73004ba1883bbf91c9e40f613ffc857

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

index 6bf30971e2b65e573cf6d5a1fb17b00f0fa18d8c..622e6ab747190acbbf8a528831e8db18a3ee9533 100644 (file)
@@ -1041,8 +1041,7 @@ 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 (ret == 0 &&
-           map->hdr.log_file_tail_offset < index->log->head->max_tail_offset) {
+       if (map->hdr.log_file_tail_offset < index->log->head->max_tail_offset) {
                map->hdr.log_file_tail_offset =
                        index->log->head->max_tail_offset;
        }