From: Timo Sirainen Date: Sun, 13 Jun 2010 14:40:57 +0000 (+0100) Subject: mdbox: Fixed crashing when marking mdbox corrupted and mdbox map had open transactions. X-Git-Tag: 2.0.rc1~179 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2604352d6bb58bd820d08bba2bd6625fb2cb113d;p=thirdparty%2Fdovecot%2Fcore.git mdbox: Fixed crashing when marking mdbox corrupted and mdbox map had open transactions. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/dbox-multi/mdbox-map.c b/src/lib-storage/index/dbox-multi/mdbox-map.c index 69a51f3acc..be278b366c 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-map.c +++ b/src/lib-storage/index/dbox-multi/mdbox-map.c @@ -189,6 +189,11 @@ int mdbox_map_refresh(struct mdbox_map *map) mail_index_reset_error(map->index); return -1; } + if (mail_index_view_get_transaction_count(map->view) > 0) { + /* can't sync when there are transactions */ + return 0; + } + ctx = mail_index_view_sync_begin(map->view, MAIL_INDEX_VIEW_SYNC_FLAG_FIX_INCONSISTENT); if (mail_index_view_sync_commit(&ctx, &delayed_expunges) < 0) {