Re: sync & asyck i/o

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 6 Feb 2001 14:52:40 +0000 (GMT)


> According to the man page for fsync it copies in-core data to disk
> prior to its return. Does that take async i/o to the media in account?
> I.e. does it wait for completion of the async i/o to the disk?

Undefined.

In theory for a journalling file system it means the change is committed to the
log and the log to the media, and for other fs that the change is committed
to the final disk and recoverable by fsck worst case

In practice some IDE disks do write merging and small amounts of write
caching in the drive firmware so you cannot trust it 100%. In addition some
higher end controllers will store to battery backed memory caches which is
normally just fine since the reboot will play through the ram cache.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/