From: Timo Sirainen Date: Wed, 25 Mar 2020 15:45:56 +0000 (+0200) Subject: lib-index: mail_cache_lock() - Clarify why index->mapping might be TRUE here X-Git-Tag: 2.3.11.2~453 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60586966e5787e8e187001936273b45915e49797;p=thirdparty%2Fdovecot%2Fcore.git lib-index: mail_cache_lock() - Clarify why index->mapping might be TRUE here --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index 14b57b533f..15f709cf42 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -662,6 +662,10 @@ mail_cache_lock_full(struct mail_cache *cache, bool nonblock) int i; i_assert(!cache->locked); + /* the only reason why we might be in here while mapping the index is + if we're coming from mail_cache_expunge_count() while syncing the + index. */ + i_assert(!cache->index->mapping || cache->index->log_sync_locked); if (!cache->opened) (void)mail_cache_open_and_verify(cache);