Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 2010 00:28:49 +0100
From:      Bruce Cran <bruce@cran.org.uk>
To:        Ivan Voras <ivoras@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: fsync(2) manual and hdd write caching
Message-ID:  <20101027002849.00002772@unknown>
In-Reply-To: <ia7nln$piv$1@dough.gmane.org>
References:  <20101026213618.GA3013@freebsd.org> <ia7nln$piv$1@dough.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 27 Oct 2010 01:19:18 +0200
Ivan Voras <ivoras@freebsd.org> wrote:

> fsync(2) actually does behave as advertised, "auses all modified data 
> and attributes of fd to be moved to a permanent storage device". It
> is the problem of the "permanent storage device" if it caches this
> data further.

http://www.opengroup.org/onlinepubs/009695399/functions/fsync.html at
first suggests it should flush write caches, but does allow for
implementations that don't:

"The fsync() function is intended to force a physical write of data
from the buffer cache, and to assure that after a system crash or other
failure that all data up to the time of the fsync() call is recorded on
the disk."

...

"In the middle ground between these extremes, fsync() might or might
not actually cause data to be written where it is safe from a power
failure."

-- 
Bruce Cran



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101027002849.00002772>