dovecot-2.2: quota-clone: Avoid assert-crash when quota recalcul...

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 26 13:42:44 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/66a04329b5e9
changeset: 19419:66a04329b5e9
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 26 15:42:35 2015 +0200
description:
quota-clone: Avoid assert-crash when quota recalculation is triggered.
Quota recalculation opened all mailboxes and got us back to
quota_clone_flush(), which caused another dict transaction to be opened,
which caused a crash with some dict backends.

diffstat:

 src/plugins/quota-clone/quota-clone-plugin.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r 129e61ef9de4 -r 66a04329b5e9 src/plugins/quota-clone/quota-clone-plugin.c
--- a/src/plugins/quota-clone/quota-clone-plugin.c	Wed Nov 25 15:09:52 2015 +0200
+++ b/src/plugins/quota-clone/quota-clone-plugin.c	Thu Nov 26 15:42:35 2015 +0200
@@ -29,6 +29,7 @@
 struct quota_clone_mailbox {
 	union mailbox_module_context module_ctx;
 	bool quota_changed;
+	bool quota_flushing;
 };
 
 static void quota_clone_flush(struct mailbox *box)
@@ -114,8 +115,14 @@
 	struct quota_clone_mailbox *qbox = QUOTA_CLONE_CONTEXT(box);
 
 	qbox->module_ctx.super.close(box);
-	if (qbox->quota_changed)
+
+	if (qbox->quota_flushing) {
+		/* recursing back from quota recalculation */
+	} else if (qbox->quota_changed) {
+		qbox->quota_flushing = TRUE;
 		quota_clone_flush(box);
+		qbox->quota_flushing = FALSE;
+	}
 }
 
 static void quota_clone_mailbox_allocated(struct mailbox *box)


More information about the dovecot-cvs mailing list