How to know when file data has been flushed into disk?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

If a program access data like this:

1. open the file
2. write a lot of data into this file
3. close the file

Assume the underlying file system is Ext3 file system.

If Ext3 is in the data=ordered	mode,	all data will be forced directly
out to the main file system prior to its metadata being committed to
the journal.

So my questions are:
1. How will the file system be notified after all data has been
flushed into disk?

2. Unlike data=journal mode, in data=order mode, the data could be
lost if system crashes when data is being flushed to disk. When system
reboots, does journal contains the old meta data for undo?

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?

Thanks in advance for your help!

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux