dovecot: Don't fsync() saved mail if saving failed and we're goi...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jan 25 13:45:39 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/b9a9c7257f4e
changeset: 7190:b9a9c7257f4e
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jan 25 13:45:36 2008 +0200
description:
Don't fsync() saved mail if saving failed and we're going to unlink() it.

diffstat:

1 file changed, 1 insertion(+), 1 deletion(-)
src/lib-storage/index/maildir/maildir-save.c |    2 +-

diffs (12 lines):

diff -r 34057a03a357 -r b9a9c7257f4e src/lib-storage/index/maildir/maildir-save.c
--- a/src/lib-storage/index/maildir/maildir-save.c	Fri Jan 25 13:44:40 2008 +0200
+++ b/src/lib-storage/index/maildir/maildir-save.c	Fri Jan 25 13:45:36 2008 +0200
@@ -490,7 +490,7 @@ static int maildir_save_finish_real(stru
 	output_errno = ctx->output->stream_errno;
 	o_stream_destroy(&ctx->output);
 
-	if (!ctx->mbox->ibox.fsync_disable) {
+	if (!ctx->mbox->ibox.fsync_disable && !ctx->failed) {
 		if (fsync(ctx->fd) < 0) {
 			mail_storage_set_critical(storage,
 						  "fsync(%s) failed: %m", path);


More information about the dovecot-cvs mailing list