I forgot to run cvs rm... *spank*

spotted y naddy@
This commit is contained in:
ajacoutot 2012-03-15 07:11:42 +00:00
parent c65e41f5a2
commit a50bfe53e0
2 changed files with 0 additions and 91 deletions

View File

@ -1,67 +0,0 @@
$OpenBSD: patch-imap_mailbox_c,v 1.6 2012/01/06 15:34:17 ajacoutot Exp $
From d4cbb22ebeeda6e817c7eafa7d7e38997919dca1 Mon Sep 17 00:00:00 2001
From: Bron Gondwana <brong@opera.com>
Date: Fri, 06 Jan 2012 14:50:29 +0000
Subject: mailbox: safe against map_nommap
--- imap/mailbox.c.orig Fri Dec 30 22:19:18 2011
+++ imap/mailbox.c Fri Jan 6 16:22:22 2012
@@ -1312,15 +1312,15 @@ static int mailbox_refresh_index_map(struct mailbox *m
mailbox->index_size = sbuf.st_size;
- /* need to map some more space! */
- map_refresh(mailbox->index_fd, 1, &mailbox->index_base,
- &mailbox->index_len, mailbox->index_size,
- "index", mailbox->name);
-
- /* and the cache will be stale too */
+ /* the cache will be stale too */
mailbox->need_cache_refresh = 1;
}
+ /* always refresh, so we're safe for map_nommap */
+ map_refresh(mailbox->index_fd, 1, &mailbox->index_base,
+ &mailbox->index_len, mailbox->index_size,
+ "index", mailbox->name);
+
return 0;
}
@@ -2150,8 +2150,8 @@ int mailbox_rewrite_index_record(struct mailbox *mailb
session_id(), mailbox->name, mailbox->uniqueid,
record->uid, message_guid_encode(&record->guid));
}
-
- return 0;
+
+ return mailbox_refresh_index_map(mailbox);
}
/* append a single message to a mailbox - also updates everything
@@ -2255,13 +2255,6 @@ int mailbox_append_index_record(struct mailbox *mailbo
mailbox->i.num_records = recno;
mailbox->index_size += INDEX_RECORD_SIZE;
- /* extend the mmaped space for the index file */
- if (mailbox->index_len < mailbox->index_size) {
- map_refresh(mailbox->index_fd, 1, &mailbox->index_base,
- &mailbox->index_len, mailbox->index_size,
- "index", mailbox->name);
- }
-
if (config_auditlog)
syslog(LOG_NOTICE, "auditlog: append sessionid=<%s> mailbox=<%s> uniqueid=<%s> uid=<%u> guid=<%s>",
session_id(), mailbox->name, mailbox->uniqueid, record->uid,
@@ -2288,8 +2281,8 @@ int mailbox_append_index_record(struct mailbox *mailbo
session_id(), mailbox->name, mailbox->uniqueid,
record->uid);
}
-
- return 0;
+
+ return mailbox_refresh_index_map(mailbox);
}
static void mailbox_message_unlink(struct mailbox *mailbox, uint32_t uid)

View File

@ -1,24 +0,0 @@
$OpenBSD: patch-lib_cyrusdb_skiplist_c,v 1.1 2012/01/06 15:34:17 ajacoutot Exp $
From d12eed5a26f1dd8c11a37a0949083b9d103fca54 Mon Sep 17 00:00:00 2001
From: Bron Gondwana <brong@opera.com>
Date: Fri, 06 Jan 2012 14:50:06 +0000
Subject: skiplist: safe against map_nommap
--- lib/cyrusdb_skiplist.c.orig Fri Dec 30 22:19:18 2011
+++ lib/cyrusdb_skiplist.c Fri Jan 6 16:22:20 2012
@@ -1526,11 +1526,11 @@ int myabort(struct db *db, struct txn *tid)
assert(db->current_txn == tid);
- /* update the mmap so we can see the log entries we need to remove */
- update_lock(db, tid);
-
/* look at the log entries we've written, and undo their effects */
while (tid->logstart != tid->logend) {
+ /* update the mmap so we can see the log entries we need to remove */
+ update_lock(db, tid);
+
/* find the last log entry */
for (offset = tid->logstart, ptr = db->map_base + offset;
offset + RECSIZE(ptr) != (uint32_t) tid->logend;