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

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 6 15:35:41 EET 2008


details:   http://hg.dovecot.org/dovecot-1.0/rev/9879434a6339
changeset: 5570:9879434a6339
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 06 15:35:37 2008 +0200
description:
Maildir saving: Handle "out of disk space/quota" failures in fsync().

diffstat:

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

diffs (19 lines):

diff -r e19d44320065 -r 9879434a6339 src/lib-storage/index/maildir/maildir-save.c
--- a/src/lib-storage/index/maildir/maildir-save.c	Thu Oct 23 18:59:00 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-save.c	Thu Nov 06 15:35:37 2008 +0200
@@ -410,8 +410,13 @@ int maildir_save_finish(struct mail_save
 
 	if (!ctx->mbox->ibox.fsync_disable) {
 		if (fsync(ctx->fd) < 0) {
-			mail_storage_set_critical(STORAGE(ctx->mbox->storage),
-						  "fsync(%s) failed: %m", path);
+			if (ENOSPACE(errno)) {
+				mail_storage_set_error(STORAGE(ctx->mbox->storage),
+						       "Not enough disk space");
+			} else {
+				mail_storage_set_critical(STORAGE(ctx->mbox->storage),
+					"fsync(%s) failed: %m", path);
+			}
 			ctx->failed = TRUE;
 		}
 	}


More information about the dovecot-cvs mailing list