QMail and SoftUpdates

Gary Corcoran garycor at comcast.net
Mon May 17 19:26:09 PDT 2004

Xin LI wrote:

> On Mon, May 17, 2004 at 01:25:04PM -0700, Julian Elischer wrote:
> [...]
>>Softupdates is NOT unsafe for this task IF the app does an fsync()
>>before acknowldging the incoming mail. Fsync under Soft updates will not
>>return until all data and metadata associated with the file
>>has been written to disk. This will make the write as slow as a sync 
>>munted filesystem, but all other writes on the disk will proceeed at 
>>soft-updates speed.
> Oh... I missed this point, sorry. Your statement is more accurate, thanks
> for pointing this out :-)
> I think it should be noted that on ATA drives, the hardware writing
> cache (without an acknowledge back to the operating system when the data
> is actually written to the disk, like on a tagged queue enabled SCSI
> disk), is enabled by default. This will greatly disturb SoftUpdates'
> work and may lead to data loss even when the application is correctly
> doing fsync(), because with ATA hardware writing cache, the disk will
> "cheat" the opearting system - Before the data actually goes to disk,
> it tells that it is, and data is lost if crash occours here.
Umm - shouldn't it be only if *power loss* occurs here?
Even if the OS crashes, as long as power is supplied to the drive,
its firmware should finish writing the data from its cache to the
disk media, no?  And therefore, as long as one has a stable power
source, e.g. running off a UPS, there really isn't any great risk
from on-drive write caches, is there?


More information about the freebsd-fs mailing list