From aae93d3ea73004ba1883bbf91c9e40f613ffc857 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 5 Feb 2023 20:50:06 +0200 Subject: [PATCH] lib-index: Don't update log_file_tail_offset on sync if reading dovecot.index.log failed This is more of a theoretical issue, since dovecot.index.log read failure is very unlikely. --- src/lib-index/mail-index-sync-update.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib-index/mail-index-sync-update.c b/src/lib-index/mail-index-sync-update.c index 0c37995643..8c3b56d759 100644 --- a/src/lib-index/mail-index-sync-update.c +++ b/src/lib-index/mail-index-sync-update.c @@ -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; } -- 2.47.3