[dovecot-cvs] dovecot/src/lib-storage/index index-storage.c, 1.101, 1.102 index-storage.h, 1.113, 1.114

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


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

Modified Files:
	index-storage.c index-storage.h 
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: index-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- index-storage.c	18 Jan 2007 16:57:44 -0000	1.101
+++ index-storage.c	22 Feb 2007 13:37:29 -0000	1.102
@@ -362,8 +362,7 @@
 	ibox->box.opened = TRUE;
 }
 
-void index_storage_mailbox_init(struct index_mailbox *ibox,
-				struct mail_index *index, const char *name,
+void index_storage_mailbox_init(struct index_mailbox *ibox, const char *name,
 				enum mailbox_open_flags flags,
 				bool move_to_memory)
 {
@@ -381,15 +380,14 @@
 	ibox->keep_recent = (flags & MAILBOX_OPEN_KEEP_RECENT) != 0;
 	ibox->keep_locked = (flags & MAILBOX_OPEN_KEEP_LOCKED) != 0;
 	ibox->move_to_memory = move_to_memory;
-	ibox->index = index;
 
 	ibox->next_lock_notify = time(NULL) + LOCK_NOTIFY_INTERVAL;
 	ibox->commit_log_file_seq = 0;
 
 	ibox->md5hdr_ext_idx =
-		mail_index_ext_register(index, "header-md5", 0, 16, 1);
+		mail_index_ext_register(ibox->index, "header-md5", 0, 16, 1);
 
-	array_idx_set(&index->mail_index_module_contexts,
+	array_idx_set(&ibox->index->mail_index_module_contexts,
 		      mail_storage_mail_index_module_id, &ibox);
 
 	if ((flags & MAILBOX_OPEN_FAST) == 0)

Index: index-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- index-storage.h	18 Jan 2007 16:57:44 -0000	1.113
+++ index-storage.h	22 Feb 2007 13:37:29 -0000	1.114
@@ -111,8 +111,7 @@
 			enum file_lock_method lock_method);
 void index_storage_deinit(struct index_storage *storage);
 
-void index_storage_mailbox_init(struct index_mailbox *ibox,
-				struct mail_index *index, const char *name,
+void index_storage_mailbox_init(struct index_mailbox *ibox, const char *name,
 				enum mailbox_open_flags flags,
 				bool move_to_memory);
 void index_storage_mailbox_open(struct index_mailbox *ibox);



More information about the dovecot-cvs mailing list