Skip to content

Commit

Permalink
lib-index: Don't break indexes on syscall failures during index refre…
Browse files Browse the repository at this point in the history
…shing.

Especially mmap() failures due to out of memory could have triggered this.
We treated the open as successful, which meant that an empty index was
opened.
  • Loading branch information
sirainen committed Jun 19, 2016
1 parent b0c472c commit d697aa9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib-index/mail-index-sync-update.c
Expand Up @@ -955,6 +955,11 @@ int mail_index_sync_map(struct mail_index_map **_map,
&reset, &reason);
if (ret <= 0) {
mail_index_view_close(&view);
if (force && ret < 0) {
/* if we failed because of a syscall error, make sure
we return a failure. */
return -1;
}
if (force && ret == 0) {
/* the seq/offset is probably broken */
mail_index_set_error(index, "Index %s: Lost log for "
Expand Down

0 comments on commit d697aa9

Please sign in to comment.