changeset 17907:51233ae4af26

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.
author Timo Sirainen <tss@iki.fi>
date Tue, 07 Oct 2014 20:13:36 +0300
parents 66842b55d2de
children 64e59ebcfe25
files src/lib-index/mail-cache.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache.c	Tue Oct 07 19:48:34 2014 +0300
+++ b/src/lib-index/mail-cache.c	Tue Oct 07 20:13:36 2014 +0300
@@ -659,7 +659,7 @@
 			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;
 		}