[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-save.c, 1.76, 1.77
tss at dovecot.org
tss at dovecot.org
Sun Dec 17 16:35:35 UTC 2006
Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv18658/src/lib-storage/index/maildir
Modified Files:
maildir-save.c
Log Message:
Added fsync_disable setting. Also added missing fsync()ing to dbox when
saving mails.
Index: maildir-save.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-save.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- maildir-save.c 25 Nov 2006 22:17:42 -0000 1.76
+++ maildir-save.c 17 Dec 2006 16:35:33 -0000 1.77
@@ -396,12 +396,12 @@
output_errno = ctx->output->stream_errno;
o_stream_destroy(&ctx->output);
- /* FIXME: when saving multiple messages, we could get better
- performance if we left the fd open and fsync()ed it later */
- if (fsync(ctx->fd) < 0) {
- mail_storage_set_critical(STORAGE(ctx->mbox->storage),
- "fsync(%s) failed: %m", path);
- ctx->failed = TRUE;
+ if (!ctx->mbox->ibox.fsync_disable) {
+ if (fsync(ctx->fd) < 0) {
+ mail_storage_set_critical(STORAGE(ctx->mbox->storage),
+ "fsync(%s) failed: %m", path);
+ ctx->failed = TRUE;
+ }
}
if (close(ctx->fd) < 0) {
mail_storage_set_critical(STORAGE(ctx->mbox->storage),
More information about the dovecot-cvs
mailing list