Mercurial > dovecot > core-2.2
changeset 21221:11110656c294
lib-index: If index open fails with fsck, retry opening once.
The fsck should have fixed the log offsets and open should work.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Thu, 24 Nov 2016 15:14:06 +0200 |
parents | c397b75f90c3 |
children | 60fee9dbcfb7 |
files | src/lib-index/mail-index-map-read.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-map-read.c Thu Nov 24 15:12:21 2016 +0200 +++ b/src/lib-index/mail-index-map-read.c Thu Nov 24 15:14:06 2016 +0200 @@ -442,6 +442,14 @@ ret = mail_index_sync_map(&index->map, type, TRUE, reason); } + if (ret == 0) { + /* we fsck'd the index. try opening again. */ + ret = mail_index_map_latest_file(index, &reason); + if (ret > 0 && index->indexid != 0) { + ret = mail_index_sync_map(&index->map, + type, TRUE, reason); + } + } } else if (ret == 0 && !index->readonly) { /* make sure we don't try to open the file again */ if (unlink(index->filepath) < 0 && errno != ENOENT)