]> git.karo-electronics.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 16:06:20 +0000 (08:06 -0800)
commit2a8af5d4d0f69036fc02e91642f862e473350143
tree0d2f423bd3acfa772036a0a0c056f09e48297b4f
parent63762a2387882e4ff8ae77133b331abef8e6f555
ext4: fix cache flush in ext4_sync_file

(cherry picked from commit 5f3481e9a80c240f169b36ea886e2325b9aeb745)

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