]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix rotation of dovecot.list.index.log
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 23 Nov 2016 16:43:17 +0000 (18:43 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 23 Nov 2016 16:45:36 +0000 (18:45 +0200)
After b9da8540e665138b3cad0b637c08c0ab7d7a7eeb the tail offsets weren't
being updated anymore when mail_index_sync_next() wasn't used to skip
over all the data. Mailbox list index wasn't doing this, and so the log
was never rotated since tail_offset was never equal to head_offset.

src/lib-storage/list/mailbox-list-index-status.c
src/lib-storage/list/mailbox-list-index-sync.c

index 82f96433f04fc0d5a323054c0505443e1bf44176..c67963c9f2edb0743beea8ef2f7afd200c6557f6 100644 (file)
@@ -686,6 +686,8 @@ static int index_list_update_mailbox(struct mailbox *box)
                ilist->updating_status = FALSE;
        }
 
+       struct mail_index_sync_rec sync_rec;
+       while (mail_index_sync_next(list_sync_ctx, &sync_rec)) ;
        if (mail_index_sync_commit(&list_sync_ctx) < 0) {
                mailbox_set_index_error(box);
                return -1;
index 8bee86cd3117d89374f7190ef56fe0db10d22fb7..50260e35f00f7c2c48367f52e8213156d2e16622 100644 (file)
@@ -419,6 +419,8 @@ int mailbox_list_index_sync_end(struct mailbox_list_index_sync_context **_sync_c
        mail_index_view_close(&sync_ctx->view);
 
        if (success) {
+               struct mail_index_sync_rec sync_rec;
+               while (mail_index_sync_next(sync_ctx->index_sync_ctx, &sync_rec)) ;
                if ((ret = mail_index_sync_commit(&sync_ctx->index_sync_ctx)) < 0)
                        mailbox_list_index_set_index_error(sync_ctx->list);
        } else {