dovecot-2.0: mdbox: When rebuilding storage, don't use map recor...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 1 22:00:34 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/1b45f9641924
changeset: 11451:1b45f9641924
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 01 20:00:07 2010 +0100
description:
mdbox: When rebuilding storage, don't use map records that have wrong size.

diffstat:

 src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (23 lines):

diff -r 1afb59ce219b -r 1b45f9641924 src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c
--- a/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Tue Jun 01 18:43:16 2010 +0100
+++ b/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Tue Jun 01 20:00:07 2010 +0100
@@ -123,6 +123,11 @@
 		return -1;
 	if ((*m1)->offset > (*m2)->offset)
 		return 1;
+
+	if ((*m1)->size < (*m2)->size)
+		return -1;
+	if ((*m1)->size > (*m2)->size)
+		return 1;
 	return 0;
 }
 
@@ -300,6 +305,7 @@
 		/* look up the rebuild msg record for this message */
 		search_msg.file_id = rec.rec.file_id;
 		search_msg.offset = rec.rec.offset;
+		search_msg.size = rec.rec.size;
 		pos = bsearch(&search_msgp, msgs, count, sizeof(*msgs),
 			      mdbox_rebuild_msg_offset_cmp);
 		if (pos == NULL || (*pos)->map_uid != 0) {


More information about the dovecot-cvs mailing list