All of lore.kernel.org
 help / color / mirror / Atom feed
* fsync() does not flush all the file
@ 2011-09-01 18:12 Berthier, Emmanuel
  2011-09-01 21:50 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Berthier, Emmanuel @ 2011-09-01 18:12 UTC (permalink / raw)
  To: linux-fsdevel

Hi,

I work on Android platform and get a strange issue: sometimes the Sqlite journal is corrupted.
I've reproduced the issue by a simple C test program which mimics Sqlite behavior:
	Create a file
	Write around 40KB of data on it
	Flush it using fsync() or fdatasync()
	Close it
Then I power-cut the system within a couple of seconds: result: the end of the file is missing on disk.

I've reproduced the issue on different handsets (x86|arm) and different FS (ext3|ext4/barrier=1/data=write_back|ordered|journal) with Android 2.3.2 and kernel 2.6.35. These handset use eMMC memory.
I've checked with traces that the issue is upper eMMC block driver.

Some infos:
- the end of the file is flushed on eMMC only after around 5s.
- I can force the complete flush using the shell "sync" command.
- Laptop_mode is not enabled.
- dirty_write_back_centisecs has an impact on the flushing delay.
- ext3/commit option has not impact


What's wrong with fsync()?

Thanks,

Emmanuel BERTHIER.
Intel
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-02 10:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-01 18:12 fsync() does not flush all the file Berthier, Emmanuel
2011-09-01 21:50 ` Christoph Hellwig
2011-09-02  7:59   ` Berthier, Emmanuel
2011-09-02  8:13     ` Christoph Hellwig
2011-09-02 10:53       ` Berthier, Emmanuel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.