From: Timo Sirainen Date: Sat, 2 Nov 2013 10:25:09 +0000 (+0200) Subject: mdbox: When mail's refcount is too high, don't prevent shrinking the refcount. X-Git-Tag: 2.2.7~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ac3627c628013c2a20aaacb4c37e22c9eca989c;p=thirdparty%2Fdovecot%2Fcore.git mdbox: When mail's refcount is too high, don't prevent shrinking the refcount. --- diff --git a/src/lib-storage/index/dbox-multi/mdbox-map.c b/src/lib-storage/index/dbox-multi/mdbox-map.c index 071e084db6..7e86eac6cb 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-map.c +++ b/src/lib-storage/index/dbox-multi/mdbox-map.c @@ -649,7 +649,7 @@ int mdbox_map_update_refcount(struct mdbox_map_transaction_context *ctx, map_uid); return -1; } - if (old_diff + new_diff >= 32768) { + if (old_diff + new_diff >= 32768 && new_diff > 0) { /* we're getting close to the 64k limit. fail early to make it less likely that two processes increase the refcount enough times to cross the limit */