changeset 11360:8b67ccc4e2af HEAD

lib-index: Recent "save transaction commits to memory" may have assert-crashed sometimes.
author Timo Sirainen <tss@iki.fi>
date Tue, 25 May 2010 15:22:03 +0100
parents 1e45b463b93a
children 487e58ebb764
files src/lib-index/mail-transaction-log-append.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-transaction-log-append.c	Thu May 20 19:49:41 2010 +0200
+++ b/src/lib-index/mail-transaction-log-append.c	Tue May 25 15:22:03 2010 +0100
@@ -124,12 +124,11 @@
 	   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,