dovecot-1.1: Maildir saving: Handle "out of disk space/quota" fa...

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 6 15:34:08 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/af56e098c5e8
changeset: 7999:af56e098c5e8
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 06 15:33:53 2008 +0200
description:
Maildir saving: Handle "out of disk space/quota" failures in fsync() and close().
Those failures could happen with NFS (close() only if fsync_disable=yes).

diffstat:

1 file changed, 11 insertions(+), 7 deletions(-)
src/lib-storage/index/maildir/maildir-save.c |   18 +++++++++++-------

diffs (29 lines):

diff -r c54f85111fc0 -r af56e098c5e8 src/lib-storage/index/maildir/maildir-save.c
--- a/src/lib-storage/index/maildir/maildir-save.c	Thu Nov 06 02:21:34 2008 +0200
+++ b/src/lib-storage/index/maildir/maildir-save.c	Thu Nov 06 15:33:53 2008 +0200
@@ -496,14 +496,18 @@ static int maildir_save_finish_real(stru
 
 	if (!ctx->mbox->ibox.fsync_disable && !ctx->failed) {
 		if (fsync(ctx->fd) < 0) {
+			if (!mail_storage_set_error_from_errno(storage)) {
+				mail_storage_set_critical(storage,
+						  "fsync(%s) failed: %m", path);
+			}
+			ctx->failed = TRUE;
+		}
+	}
+	if (close(ctx->fd) < 0) {
+		if (!mail_storage_set_error_from_errno(storage)) {
 			mail_storage_set_critical(storage,
-						  "fsync(%s) failed: %m", path);
-			ctx->failed = TRUE;
-		}
-	}
-	if (close(ctx->fd) < 0) {
-		mail_storage_set_critical(storage,
-					  "close(%s) failed: %m", path);
+						  "close(%s) failed: %m", path);
+		}
 		ctx->failed = TRUE;
 	}
 	ctx->fd = -1;


More information about the dovecot-cvs mailing list