]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: After cache is marked corrupted, don't log error if cache file isn't found
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 31 Mar 2020 14:50:42 +0000 (17:50 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Apr 2020 09:41:43 +0000 (12:41 +0300)
It's just an unnecessary extra error.

src/lib-index/mail-cache.c

index 0aa9c0e1d83b19a3f2a0c04c1dd5991263190819..2d24ce992ae419f82ccd2af58ca2bfa832f7a8c9 100644 (file)
@@ -173,7 +173,10 @@ static bool mail_cache_need_reopen(struct mail_cache *cache)
                nfs_flush_file_handle_cache(cache->filepath);
        }
        if (nfs_safe_stat(cache->filepath, &st) < 0) {
-               mail_cache_set_syscall_error(cache, "stat()");
+               /* if cache was already marked as corrupted, don't log errors
+                  about nonexistent cache file */
+               if (cache->hdr != NULL || errno != ENOENT)
+                       mail_cache_set_syscall_error(cache, "stat()");
                return TRUE;
        }
        cache->last_stat_size = st.st_size;