SUMMARY: FSYNC and hardware interoperability

From: Siebert, Aaron (aaron.siebert@nagrastar.com)
Date: Thu Feb 27 2003 - 18:20:23 EST


Thanks the infamous Thomas Blinn and Alan Rollow. Please see responses
to the original question.

Tom Blinn
There is no way, in full generality, to assure that when the operating
system (ANY operating system) tells a set of hardware to do something,
it has really been done, but in general, if you turn off any kind of
write buffering in the disks (or RAID controllers), you will usually get
a real "sync" from this. But some devices say they've written the data
to permanent storage (something not susceptible to, say, power
failure) when they haven't -- in other words, they lie. What level of
certainty do you need, and what level of investigation are you willing
to do to assure that things are really working? For most commercial
purposes, "fsync()" is as close as you're going to get.

Alan Rollow
All the synchronous write hooks (fsync(2), O_SYNC, etc)
        depend on the underlying hardware not lying when it says
        the data is written. With enough different ways for these
        subsystems to implement caching, there's little hope for
        the operating system to be able to know all the ways of
        turning it off. So, if a subsystem supports write-back
        caching, the operating system has little hope of knowing
        that and therefore little hope of being able to turn it
        off.

        If you don't trust the storage subsystem's promise that
        data in the cache is at least as available and safe as
        on media, you need to find a way to get the caching turned
        off at the subsystem level.

        Bare SCSI disks can support a fairly standardized way of
        letting a host know they support write caching. Some
        operating systems and subsystems may blindly turn this
        off, since they're not inclined to trust it either. But,
        the more interesting subsystem caching implementations
        aren't likely to be so easily controlled.

-----Original Message-----
From: Siebert, Aaron
Sent: Thursday, February 27, 2003 3:43 PM
To: tru64-unix-managers@ornl.gov
Subject: FSYNC and hardware interoperability

Managers,

This question applies to most UNIX platforms including Tru64. We have a
need to ensure that data is written to disk. We are planning to use the
fsync command to ensure that the data was written. However, we are
concerned that at the hardware level, intelligent caching may have some
way to disguise if the data was actually written to disk or is waiting
to be committed. Basically, our understanding is that executing the
fsync command ensures that the data has been committed to disk
regardless of the hardware/controller/disk application. Can anyone
confirm this or does anyone have any suggestions?

Thanks

Aaron Siebert
IT Systems Engineer Nagrastar
Desk: 303-706-5492
Fax: 303-706-5719
Aaron.Siebert@Nagrastar.com



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:09 EDT