]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix cache flush in ext4_sync_file
authorChristoph Hellwig <hch@lst.de>
Sun, 6 Sep 2009 01:42:42 +0000 (21:42 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 6 Sep 2009 01:42:42 +0000 (21:42 -0400)
commitf0a4f62dac6e2300a50a236e03492dbbea3638ba
tree435a8cf2be9c81a545f42d5af881450f8d121e74
parentd7d2d7a4e24129847ac80cdcf14ea4e57107231b
ext4: fix cache flush in ext4_sync_file

We need to flush the write cache unconditionally in ->fsync, otherwise
writes into already allocated blocks can get lost.  Writes into fully
allocated files are very common when using disk images for
virtualization, and without this fix can easily lose data after
an fdatasync, which is the typical implementation for a cache flush on
the virtual drive.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/fsync.c