# HG changeset patch # User Timo Sirainen # Date 1182295075 -10800 # Node ID 01c94fef35789123ede8127f58718f7d47b9f8a2 # Parent b6cf05796f6deb437f4e378872204f68298403ea If read() returned a partial transaction, don't give an error because it could be just that kernel temporarily didn't return the expected data. diff -r b6cf05796f6d -r 01c94fef3578 src/lib-index/mail-transaction-log-file.c --- a/src/lib-index/mail-transaction-log-file.c Wed Jun 20 01:56:39 2007 +0300 +++ b/src/lib-index/mail-transaction-log-file.c Wed Jun 20 02:17:55 2007 +0300 @@ -727,11 +727,12 @@ avail = file->sync_offset - file->buffer_offset; if (avail != size && avail >= sizeof(*hdr)) { - /* record goes outside the file we've seen. or if - we're accessing the log file via unlocked mmaped - memory, it may be just that the memory was updated - after we checked the file size. */ - if (file->locked || file->mmap_base == NULL) { + /* Record goes outside the file we've seen. Unless we're + locked, we can't know if this is expected or not. Even when + we're read()ing the file, the kernel (at least Linux 2.6) + can show the last read memory page updated, but without the + expected next page. */ + if (file->locked) { if (trans_size != 0) { mail_transaction_log_file_set_corrupted(file, "hdr.size too large (%u)", trans_size);