Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5787:01c94fef3578 HEAD
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.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 20 Jun 2007 02:17:55 +0300 |
parents | b6cf05796f6d |
children | bdb16967be64 |
files | src/lib-index/mail-transaction-log-file.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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);