From: Timo Sirainen Date: Tue, 7 Oct 2014 17:13:36 +0000 (+0300) Subject: lib-index: Fixed assert-crash in some cache locking race conditions. X-Git-Tag: 2.2.14~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=425cbcea60cf689b0069698c83f8bdc474d70693;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Fixed assert-crash in some cache locking race conditions. If mail_index_map() is being called, we can't refresh the index or it'll crash. It wouldn't help anyway, since the index was just refreshed. --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index 4d3df22dfa..5a65ec8f46 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -659,7 +659,7 @@ mail_cache_lock_full(struct mail_cache *cache, bool nonblock) break; /* mismatch. try refreshing index once. if that doesn't help, we can't use the cache. */ - if (i > 0) { + if (i > 0 || cache->index->mapping) { mail_cache_unlock_file(cache); return 0; }