From: Timo Sirainen Date: Tue, 25 May 2010 14:22:03 +0000 (+0100) Subject: lib-index: Recent "save transaction commits to memory" may have assert-crashed sometimes. X-Git-Tag: 2.0.beta6~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6370c8138546e27119c6da3d482b7ea7c0b2289;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Recent "save transaction commits to memory" may have assert-crashed sometimes. --HG-- branch : HEAD --- 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,