]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: When purging writes new data, flush them to disk before locking the map index.
authorTimo Sirainen <tss@iki.fi>
Fri, 20 Dec 2013 17:59:22 +0000 (19:59 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 20 Dec 2013 17:59:22 +0000 (19:59 +0200)
src/lib-storage/index/dbox-multi/mdbox-purge.c

index 41decd67ac3cfd256d4ccbccacdffdb739d7f197..d1c3fb040429b155cbd30517a6ab51f37af368b5 100644 (file)
@@ -383,6 +383,11 @@ mdbox_file_purge(struct mdbox_purge_context *ctx, struct dbox_file *file,
                        "(%"PRIuUOFF_T" < %"PRIuUOFF_T")", offset, st.st_size);
                ret = 0;
        }
+       if (ret > 0 && ctx->append_ctx != NULL) {
+               /* flush writes before locking the map */
+               if (mdbox_map_append_flush(ctx->append_ctx) < 0)
+                       ret = -1;
+       }
 
        if (ret <= 0)
                ret = -1;