# HG changeset patch # User Timo Sirainen # Date 1191159936 -10800 # Node ID d79975141df2c34fd591d52997718327180ce43b # Parent d0689497bb11b6b70181cb923adb7be4c640b99b Fixes to NFS read cache flushing. diff -r d0689497bb11 -r d79975141df2 src/lib-index/mail-cache-compress.c --- a/src/lib-index/mail-cache-compress.c Sun Sep 30 16:27:12 2007 +0300 +++ b/src/lib-index/mail-cache-compress.c Sun Sep 30 16:45:36 2007 +0300 @@ -307,7 +307,6 @@ return -1; } - mail_cache_flush_read_cache(cache, FALSE); ret = read_full(fd, &hdr, sizeof(hdr)); close_keep_errno(fd); @@ -338,7 +337,7 @@ unsigned int i, count; int fd, ret; - if (cache->fd != -1) + if (!MAIL_CACHE_IS_UNUSABLE(cache)) mail_cache_flush_read_cache(cache, TRUE); /* get the latest info on fields */ diff -r d0689497bb11 -r d79975141df2 src/lib-index/mail-cache-sync-update.c --- a/src/lib-index/mail-cache-sync-update.c Sun Sep 30 16:27:12 2007 +0300 +++ b/src/lib-index/mail-cache-sync-update.c Sun Sep 30 16:45:36 2007 +0300 @@ -159,6 +159,7 @@ void mail_cache_sync_lost_handler(struct mail_index *index) { - mail_cache_flush_read_cache(index->cache, FALSE); + if (!MAIL_CACHE_IS_UNUSABLE(index->cache)) + mail_cache_flush_read_cache(index->cache, FALSE); file_cache_invalidate(index->cache->file_cache, 0, (uoff_t)-1); }