dovecot-2.0: quota: Mark the mailbox deleted before starting to ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 24 19:01:32 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/6933cfa5315a
changeset: 12041:6933cfa5315a
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 24 17:01:27 2010 +0100
description:
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.

diffstat:

 src/plugins/quota/quota-storage.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff -r 72b5a0af6e4e -r 6933cfa5315a src/plugins/quota/quota-storage.c
--- a/src/plugins/quota/quota-storage.c	Tue Aug 24 17:00:39 2010 +0100
+++ b/src/plugins/quota/quota-storage.c	Tue Aug 24 17:01:27 2010 +0100
@@ -347,6 +347,9 @@
 	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);
 


More information about the dovecot-cvs mailing list