On Sun, May 06, 2001 at 12:47:45PM +0200, Ragnar Kjørstad wrote:
> A MTA should write the mail to disk (and use fsync) _before_ it tells
> the sender that the mail has been accepted. This way there is no risk of
> loosing mail. I believe qmail doesn't use fsync, but relies on the
> filesystem beeing mounted with sync-option (or chattr +S on that
> directory). Because doing all IO syncroniously would kill performance,
> the reiserfs-team fixed qmail instead of suggesting that people mount
> with sync option (or implement chattr +S).
qmail uses fsync, but relies on the file system to flush metadata
in the spool dir (directory names etc.) synchronously. The guarantee
in reiserfs that fsync flushes all pending transactions works fine with
qmail. The fsync on the file data after file create forces the filename
on disk which has been in an earlier transaction, and any other metadata
operations after the fsync (rename/link in Maildir etc.) which could be lost
are redoable after a crash.
I am not sure if XFS has the same strong ordering (fsync flushing all pending
transactions), perhaps one of the XFS developers could comment.
-Andi
|