lkml.org 
[lkml]   [2006]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to know when file data has been flushed into disk?

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

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

\
 
 \ /
  Last update: 2006-04-08 01:56    [W:0.787 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site