Re: Ext2, fsync() and MTA's?

Stephen C. Tweedie
2001-05-21T17:49:09Z

Hi,

On Sun, May 13, 2001 at 12:53:37AM +1000, Andrew McNamara wrote:

> I seem to recall that in 2.2, fsync behaved like fdatasync, and that
> it's only in 2.4 that it also syncs metadata - is this correct?

No, fsync should be safe on 2.2. There was a problem with O_SYNC not
syncing all metadata on 2.2 if you were extending a file, but that
never applied to fsync.

> Do the BSD's sync the directory data on an fsync of a file? I guess
> this is the bone of contention

No --- the old BSDs were safe because their directory operations were
fully synchronous so they *never* needed to be sync'ed manually.
According to SuS, an application relying on sync directory updates is
buggy, because SuS simply makes no such guarantees.

Just set chattr +S on the spool dir. That's what the flag is for.
The biggest problem with that is that it propagates to subdirectories
and files --- would a version of the flag which applied only to
directories be a help here?

Cheers,
Stephen