From: Ric Wheeler <ric@emc.com>
To: Douglas McNaught <doug@mcnaught.org>
Cc: Xin Zhao <uszhaoxin@gmail.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: How to know when file data has been flushed into disk?
Date: Fri, 07 Apr 2006 19:54:04 -0400 [thread overview]
Message-ID: <4436FB9C.40706@emc.com> (raw)
In-Reply-To: <87slop1ix2.fsf@suzuka.mcnaught.org>
Douglas McNaught wrote:
>"Xin Zhao" <uszhaoxin@gmail.com> writes:
>
>
>
>>3. Does sys_close() have to be blocked until all data and metadata
>>are committed? If not, sys_close() may give application an illusion
>>that the file is successfully written, which can cause the application
>>to take subsequent operation. However, data flush could be failed. In
>>this case, file system seems to mislead the application. Is this true?
>>If so, any solutions?
>>
>>
>
>The fsync() call is the way to make sure written data has hit the
>disk. close() doesn't guarantee that.
>
>-Doug
>
>
>
You should also make sure, if you care about data recovery after a power
outage, that you have either disabled the write cache on your drives or
have a working write barrier. Without this, fsync will move the data
from the page cache to the disk's write cache where it is up to the
drive firmware to write it back to permanent, safe storage on the disk
platter.
ric
next prev parent reply other threads:[~2006-04-07 23:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-07 15:42 How to know when file data has been flushed into disk? Xin Zhao
2006-04-07 15:53 ` Douglas McNaught
2006-04-07 16:04 ` Xin Zhao
2006-04-07 16:55 ` linux-os (Dick Johnson)
2006-04-07 17:19 ` Xin Zhao
2006-04-07 23:54 ` Ric Wheeler [this message]
2006-04-07 17:54 ` Zach Brown
2006-04-08 1:39 ` Xin Zhao
-- strict thread matches above, loose matches on Subject: below --
2006-04-07 21:07 Michael Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4436FB9C.40706@emc.com \
--to=ric@emc.com \
--cc=doug@mcnaught.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=uszhaoxin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox