changeset 6343:c76101b824ec HEAD

Don't treat uid_validity=0 && next_uid!=1 as a corrupted index. fsck fixes it.
author Timo Sirainen <tss@iki.fi>
date Sun, 02 Sep 2007 03:05:38 +0300
parents 702f13f44c5e
children e45ba2950722
files src/lib-index/mail-index-map.c
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-map.c	Sun Sep 02 03:04:47 2007 +0300
+++ b/src/lib-index/mail-index-map.c	Sun Sep 02 03:05:38 2007 +0300
@@ -272,13 +272,6 @@
 		return -1;
 
 	/* following some extra checks that only take a bit of CPU */
-	if (hdr->uid_validity == 0 && hdr->next_uid != 1) {
-		mail_index_set_error(index, "Corrupted index file %s: "
-				     "uid_validity = 0, next_uid = %u",
-				     index->filepath, hdr->next_uid);
-		return -1;
-	}
-
 	if (hdr->record_size < sizeof(struct mail_index_record)) {
 		mail_index_set_error(index, "Corrupted index file %s: "
 				     "record_size too small: %u < %"PRIuSIZE_T,
@@ -290,6 +283,8 @@
 	if ((hdr->flags & MAIL_INDEX_HDR_FLAG_FSCK) != 0)
 		return 0;
 
+	if (hdr->uid_validity == 0 && hdr->next_uid != 1)
+		return 0;
 	if (hdr->next_uid == 0)
 		return 0;