]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Recent "save transaction commits to memory" may have assert-crashed sometimes.
authorTimo Sirainen <tss@iki.fi>
Tue, 25 May 2010 14:22:03 +0000 (15:22 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 25 May 2010 14:22:03 +0000 (15:22 +0100)
--HG--
branch : HEAD

src/lib-index/mail-transaction-log-append.c

index 55b896aac855e5b5c45f2c4254567036d6f5c301..3dc13e08ed5e3ac441825c7cbf59032856423b35 100644 (file)
@@ -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,