We found that fsync and fdatasync syscalls sometimes don't sync
data in an ext3 file system under the following conditions.
1. Kernel version is 2.6.6 or later (including 126.96.36.199 and 2.6.9-rc2).
2. Ext3's journalling mode is "data=journal".
The problem was occurred since 2.6.5-bk1, which includes the patch
"[PATCH] ext3 fsync() and fdatasync() speedup". We found that the
problem was solved by deleting the part of the patch which
modifies ext3_sync_file(). Maybe, i_state is not correctly set to
I_DIRTY when the related page cache is dirty (is it true?)