On 2006-09-22, Jim Nasby <[EMAIL PROTECTED]> wrote: > I thought folks might be interested in this... note in particular the > comment about linux.
I don't believe that either person in that discussion knows what they are really talking about. fsync() on FreeBSD does, as is required, force any modified data for the file, plus any metadata, plus any modifications to any parent directories, to the underlying disk device and waits for that device to report the write as complete. Whether the underlying device lies about the write completion is another matter. All current SCSI disks have WCE enabled by default, which means that they will lie about write completion if FUA was not set in the request, which FreeBSD never sets. (It's not possible to get correct results by having fsync() somehow selectively set FUA, because that would leave previously-completed requests in the cache.) WCE can be disabled on either a temporary or permanent basis by changing the appropriate modepage. It's possible that Linux does this automatically, or sets FUA on all writes, though that would surprise me considerably; however I disclaim any knowledge of Linux internals. On FreeBSD, this command will disable WCE permanently on a SCSI drive: echo 'WCE: 0' | camcontrol modepage daXX -m 8 -P3 -e (use -P0 to disable it only temporarily, or you can use just the second of those commands alone to interactively edit the mode page) -- Andrew, Supernews http://www.supernews.com - individual and corporate NNTP services ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend