From b5d17f9b1224f496f18b45579a4253df3ae0dbba Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 2 Mar 2010 15:42:50 +0200 Subject: [PATCH] mdbox: Don't assert-cras if refcount in map file is too low. --HG-- branch : HEAD --- src/lib-storage/index/dbox-multi/mdbox-map.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/index/dbox-multi/mdbox-map.c b/src/lib-storage/index/dbox-multi/mdbox-map.c index bc09d51f26..db222c2b33 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-map.c +++ b/src/lib-storage/index/dbox-multi/mdbox-map.c @@ -427,7 +427,11 @@ int dbox_map_update_refcounts(struct dbox_map_transaction_context *ctx, ctx->changed = TRUE; cur_diff += mail_index_atomic_inc_ext(ctx->trans, seq, map->ref_ext_id, diff); - i_assert(cur_diff >= 0); + if (cur_diff < 0) { + dbox_map_set_corrupted(map, + "map_uid=%u refcount too low", *uidp); + return -1; + } if (cur_diff >= 32768) { /* we're getting close to the 64k limit. fail early to make it less likely that two processes increase -- 2.47.3