]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: When doing a cleanup, need to refresh map index after locking.
authorTimo Sirainen <tss@iki.fi>
Tue, 10 Mar 2009 15:22:26 +0000 (11:22 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 10 Mar 2009 15:22:26 +0000 (11:22 -0400)
--HG--
branch : HEAD

src/lib-storage/index/dbox/dbox-map.c

index 7fee4552908744054001ab12fb0ada7234db69f6..fb539bd59bb33693e3dbf4f5bcc46202ac3f1afe 100644 (file)
@@ -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);