Ext2, fsync() and MTA's?

Andrew McNamara (andrewm@connect.com.au)
Sat, 12 May 2001 21:50:34 +1000


Is the following still true in 2.4 (fsync() doesn't ensure directory
and inode data is up to date)? I had a feeling this had been fixed.

Under Linux, the Postfix MTA sets "chattr +S" on it's spool directories
- obviously this hurts it's performance badly (compared to the BSD's).
It would be really nice to be able to say it's no longer necessary. It
wants to know that a file (file data, inode and directory entry) are
commited to stable storage when an fsync returns.

------- Forwarded Message

Date: Fri, 11 May 2001 19:17:03 -0400
From: wietse@porcupine.org (Wietse Venema)
To: Postfix users <postfix-users@postfix.org>
Subject: Re: maildir or not

David W. Chapman Jr.:
> I think that's the point. Linux's fsync doesn't fsynch like most other
> unices, it still writes async. There fore its not totally stable because
> you think you are writting sync when in fact you aren't. I might be wrong,
> but this is what I have been hearing.

Linux fsync flushes the file data blocks.

The debate is about Linux's directory updates.

Postfix can open/write/fsync/close a file successfully, and Linux
can still lose the file because the directory entry was not updated.

This is why Postfix turns on synchronous writes on dircetories.
Unfortunately, that also makes file writes synchronous. I will
not sacrifice reliability for the sake of performance.

Wietse

- -
To unsubscribe, send mail to majordomo@postfix.org with content
(not subject): unsubscribe postfix-users

------- End of Forwarded Message

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/