From d6370c8138546e27119c6da3d482b7ea7c0b2289 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 25 May 2010 15:22:03 +0100 Subject: [PATCH] lib-index: Recent "save transaction commits to memory" may have assert-crashed sometimes. --HG-- branch : HEAD --- src/lib-index/mail-transaction-log-append.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib-index/mail-transaction-log-append.c b/src/lib-index/mail-transaction-log-append.c index 55b896aac8..3dc13e08ed 100644 --- a/src/lib-index/mail-transaction-log-append.c +++ b/src/lib-index/mail-transaction-log-append.c @@ -124,12 +124,11 @@ static int log_buffer_write(struct mail_transaction_log_append_ctx *ctx) if it crashes before doing that, we'll need to overwrite it with a dummy record */ - if (file->mmap_base == NULL) { + if (file->mmap_base == NULL && file->buffer != NULL) { /* we're reading from a file. avoid re-reading the data that we just wrote. this is also important for some NFS clients, which for some reason sometimes can't read() this data we just wrote in the same process */ - i_assert(file->buffer != NULL); i_assert(file->buffer_offset + file->buffer->used == file->sync_offset); buffer_append(file->buffer, ctx->output->data, -- 2.47.3