fsync() does not flush all the file

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

 



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.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux