]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: mail_cache_lock() - Clarify why index->mapping might be TRUE here
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 25 Mar 2020 15:45:56 +0000 (17:45 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Apr 2020 08:57:20 +0000 (08:57 +0000)
src/lib-index/mail-cache.c

index 14b57b533feeb03200a36bee35dd7bb16950b879..15f709cf42c1db2e48373557a7a819f2c6369930 100644 (file)
@@ -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);