]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fs/libfs.c: add generic data flush to fsync
authorFabian Frederick <fabf@skynet.be>
Thu, 22 May 2014 00:42:35 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:42:35 +0000 (10:42 +1000)
commit2f2e34441b7be4f49cc3a9ac3e45b11353a03356
tree0c7a885cd1c994b1e136f50b3f40a30d9d050f30
parent97b2e2bcba660a2ec1f34a47ce3e7bbbe285a661
fs/libfs.c: add generic data flush to fsync

Description by Jan Kara:
"A lot of older filesystems don't properly flush volatile disk caches
on fsync(2) which can lead to loss of fsynced data after power failure.

This patch makes generic_file_fsync() issue proper cache flush to fix the
problem.  Sysadmin can use /sys/devices/.../cache_type to tell the system
it should not send the cache flush."

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Suggested-by: Jan Kara <jack@suse.cz>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/libfs.c
include/linux/fs.h