dovecot-2.2: mbox: Avoid assert-crashing by too optimistically u...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 24 23:14:55 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/04c7cf45a597
changeset: 16542:04c7cf45a597
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 24 23:10:20 2013 +0300
description:
mbox: Avoid assert-crashing by too optimistically upgrading a lock to write-lock.

diffstat:

 src/lib-storage/index/mbox/mbox-lock.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 07e314199f56 -r 04c7cf45a597 src/lib-storage/index/mbox/mbox-lock.c
--- a/src/lib-storage/index/mbox/mbox-lock.c	Mon Jun 24 23:06:45 2013 +0300
+++ b/src/lib-storage/index/mbox/mbox-lock.c	Mon Jun 24 23:10:20 2013 +0300
@@ -784,7 +784,8 @@
 	bool fcntl_locked;
 	int ret;
 
-	if (lock_type == F_RDLCK && mbox->external_transactions > 0) {
+	if (lock_type == F_RDLCK && mbox->external_transactions > 0 &&
+	    mbox->mbox_lock_type != F_RDLCK) {
 		/* we have a transaction open that is going to save mails
 		   and apparently also wants to read from the same mailbox
 		   (copy, move, catenate). we need to write lock the mailbox,


More information about the dovecot-cvs mailing list