From: Timo Sirainen Date: Tue, 10 Mar 2009 15:22:26 +0000 (-0400) Subject: dbox: When doing a cleanup, need to refresh map index after locking. X-Git-Tag: 2.0.alpha1~1038^2~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=532bf55fb072cd749e4b72ad622dcaee9156095d;p=thirdparty%2Fdovecot%2Fcore.git dbox: When doing a cleanup, need to refresh map index after locking. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/dbox/dbox-map.c b/src/lib-storage/index/dbox/dbox-map.c index 7fee455290..fb539bd59b 100644 --- a/src/lib-storage/index/dbox/dbox-map.c +++ b/src/lib-storage/index/dbox/dbox-map.c @@ -324,6 +324,11 @@ int dbox_map_remove_file_id(struct dbox_map *map, uint32_t file_id) uint32_t log_seq; uoff_t log_offset; + /* make sure the map is refreshed, otherwise we might be expunging + messages that have already been moved to other files. */ + if (dbox_map_refresh(map) < 0) + return -1; + trans = mail_index_transaction_begin(map->view, MAIL_INDEX_TRANSACTION_FLAG_EXTERNAL); hdr = mail_index_get_header(map->view);