Maildir saving: Handle "out of disk space/quota" failures in fsync().
--- 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;
}
}