]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Mark the mailbox deleted before starting to reduce quota.
authorTimo Sirainen <tss@iki.fi>
Tue, 24 Aug 2010 16:01:27 +0000 (17:01 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 24 Aug 2010 16:01:27 +0000 (17:01 +0100)
This fixes race conditions with another process modifying the same mailbox
at the same time.

src/plugins/quota/quota-storage.c

index 27ab39abf06223bea635d3c89c5a303567b9f638..65e39c0dd41ae473b0b6642e851b8bb31271d1b5 100644 (file)
@@ -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);