Charles Cazabon <[EMAIL PROTECTED]> wrote:
>The problem comes from the fact that Linux does not adhere to BSD semantics
>regarding the sync() system call. BSD semantics state that if you sync a
>file, it's data and it's metadata are synced to disc.
>
>Linux, on the other hand, syncs only the data. To sync the metadata, you have
>to sync() the directory the file resides in.
This depends upon the filesystem. E2fs behaves that way, but XFS and
ReiserFS don't.
But the real problem with ReiserFS (and XFS) and qmail is that Dan
assumes that link() is synchronous. That might be true for FFS
filesystems, especially under BSD, but it's not true for ReiserFS and
XFS.
The ReiserFS people have a patch available from:
http://www.jedi.claranet.fr/qmail-link-sync.patch
Which adds sync's after link's. It should be used with XFS
filesystems, too.
But, looking at the patch, I see that it doesn't fsync() after the
"mess" link is created in qmail-queue.c. Hmm... Looks like he changed
something in that area, then undid it:
- if (link(pidfn,messfn) == -1) die(64);
+ if (link(pidfn,messfn) == -1) die(64);
I wonder why...
-Dave