]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Copying wasn't locking map index early enough.
authorTimo Sirainen <tss@iki.fi>
Mon, 19 Jul 2010 12:02:24 +0000 (13:02 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 19 Jul 2010 12:02:24 +0000 (13:02 +0100)
src/lib-storage/index/dbox-multi/mdbox-save.c

index 7a4a5ddb3c09b3ac2b1ab64a3a18c1083426674e..abfe69246a2f8f5df6b05b4ed6318cd23aa049a8 100644 (file)
@@ -286,6 +286,10 @@ int mdbox_transaction_save_commit_pre(struct mail_save_context *_ctx)
 
        i_assert(ctx->ctx.finished);
 
+       /* make sure the map gets locked */
+       if (mdbox_map_atomic_lock(ctx->atomic) < 0)
+               return -1;
+
        /* assign map UIDs for newly saved messages. they're written to
           transaction log immediately within this function, but the map
           is left locked. */