From: Timo Sirainen Date: Tue, 24 Aug 2010 16:01:27 +0000 (+0100) Subject: quota: Mark the mailbox deleted before starting to reduce quota. X-Git-Tag: 2.0.1~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b79a09b5915ff12c10d2e5accf4318776a152e80;p=thirdparty%2Fdovecot%2Fcore.git quota: Mark the mailbox deleted before starting to reduce quota. This fixes race conditions with another process modifying the same mailbox at the same time. --- diff --git a/src/plugins/quota/quota-storage.c b/src/plugins/quota/quota-storage.c index 27ab39abf0..65e39c0dd4 100644 --- a/src/plugins/quota/quota-storage.c +++ b/src/plugins/quota/quota-storage.c @@ -347,6 +347,9 @@ quota_mailbox_delete_shrink_quota(struct mailbox *box) struct mail *mail; struct mail_search_args *search_args; + if (mailbox_mark_index_deleted(box, TRUE) < 0) + return -1; + t = mailbox_transaction_begin(box, 0); qt = quota_transaction_begin(box);