[dovecot-cvs] dovecot/src/lib-storage/index/dbox dbox-storage.c, 1.36, 1.37

tss at dovecot.org tss at dovecot.org
Thu Feb 22 13:37:32 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib-storage/index/dbox
In directory talvi:/tmp/cvs-serv13052/dbox

Modified Files:
	dbox-storage.c 
Log Message:
When using KEEP_LOCK, the mbox/uidlist file must be locked before index file
is opened. Otherwise we can end up in a deadlock.



Index: dbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/dbox/dbox-storage.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- dbox-storage.c	22 Feb 2007 13:08:31 -0000	1.36
+++ dbox-storage.c	22 Feb 2007 13:37:30 -0000	1.37
@@ -295,8 +295,7 @@
 	mbox->ibox.storage = istorage;
 	mbox->ibox.mail_vfuncs = &dbox_mail_vfuncs;
 	mbox->ibox.is_recent = dbox_is_recent;
-
-	index_storage_mailbox_init(&mbox->ibox, index, name, flags, FALSE);
+	mbox->ibox.index = index;
 
 	value = getenv("DBOX_ROTATE_SIZE");
 	if (value != NULL)
@@ -324,7 +323,7 @@
 					sizeof(uint64_t), sizeof(uint64_t));
 
 	mbox->uidlist = dbox_uidlist_init(mbox);
-	if (mbox->ibox.keep_locked) {
+	if ((flags & MAILBOX_OPEN_KEEP_LOCKED) != 0) {
 		if (dbox_uidlist_lock(mbox->uidlist) < 0) {
 			struct mailbox *box = &mbox->ibox.box;
 
@@ -335,6 +334,8 @@
 						 dbox_lock_touch_timeout,
 						 mbox);
 	}
+
+	index_storage_mailbox_init(&mbox->ibox, name, flags, FALSE);
 	return &mbox->ibox.box;
 }
 



More information about the dovecot-cvs mailing list