]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Thread strmap must not be opened before index is opened.
authorTimo Sirainen <tss@iki.fi>
Sat, 20 Feb 2010 07:46:43 +0000 (09:46 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 20 Feb 2010 07:46:43 +0000 (09:46 +0200)
--HG--
branch : HEAD

src/lib-index/mail-index-strmap.c
src/lib-storage/index/index-storage.c
src/lib-storage/index/index-thread-private.h
src/lib-storage/index/index-thread.c

index abcde3a0dcbddd9265f81aed3ea013f23d612f02..a435c07a26691c974ac5ed31996d9aeec4efdae1 100644 (file)
@@ -99,6 +99,8 @@ mail_index_strmap_init(struct mail_index *index, const char *suffix)
 {
        struct mail_index_strmap *strmap;
 
+       i_assert(index->open_count > 0);
+
        strmap = i_new(struct mail_index_strmap, 1);
        strmap->index = index;
        strmap->path = i_strconcat(index->filepath, suffix, NULL);
index b5d1b6a9449c8daba10162baee5028c8b1580aa2..c303c3b6e0abf4d51ee2275cf85d7da9c081fee1 100644 (file)
@@ -243,6 +243,7 @@ int index_storage_mailbox_open(struct mailbox *box, bool move_to_memory)
 
        box->opened = TRUE;
 
+       index_thread_mailbox_opened(box);
        if (hook_mailbox_opened != NULL)
                hook_mailbox_opened(box);
 
@@ -292,8 +293,6 @@ void index_storage_mailbox_alloc(struct mailbox *box, const char *name,
        mail_index_set_permissions(box->index, box->file_create_mode,
                                   box->file_create_gid,
                                   box->file_create_gid_origin);
-
-       index_thread_mailbox_allocated(box);
 }
 
 int index_storage_mailbox_enable(struct mailbox *box,
index 5b33ad36fa201a2aa7d99a983af4e6640a814711..4f44319188c353512ac7ea27f798703d33848ed7 100644 (file)
@@ -77,6 +77,6 @@ mail_thread_iterate_init_full(struct mail_thread_cache *cache,
                              enum mail_thread_type thread_type,
                              bool return_seqs);
 
-void index_thread_mailbox_allocated(struct mailbox *box);
+void index_thread_mailbox_opened(struct mailbox *box);
 
 #endif
index 9df859869642038a4974cb53baa1bbeb926023ce..5f47874ffde19ee53a15d41b531dd7eb7e3c3df0 100644 (file)
@@ -639,7 +639,7 @@ static void mail_thread_mailbox_free(struct mailbox *box)
        i_free(tbox);
 }
 
-void index_thread_mailbox_allocated(struct mailbox *box)
+void index_thread_mailbox_opened(struct mailbox *box)
 {
        struct mail_thread_mailbox *tbox;