The patch titled blkdev: flush disk cache on ->fsync has been removed from the -mm tree. Its filename was blkdev-flush-disk-cache-on-fsync.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: blkdev: flush disk cache on ->fsync From: Christoph Hellwig <hch@xxxxxx> Currently there is no barrier support in the block device code. That means we cannot guarantee any sort of data integrity when using the block device node with dis kwrite caches enabled. Using the raw block device node is a typical use case for virtualization (and I assume databases, too). This patch changes block_fsync to issue a cache flush and thus make fsync on block device nodes actually useful. Note that in mainline we would also need to add such code to the ->aio_write method for O_SYNC handling, but assuming that Jan's patch series for the O_SYNC rewrite goes in it will also call into ->fsync for 2.6.32. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Cc: Jan Kara <jack@xxxxxxx> Cc: Jens Axboe <jens.axboe@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/block_dev.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff -puN fs/block_dev.c~blkdev-flush-disk-cache-on-fsync fs/block_dev.c --- a/fs/block_dev.c~blkdev-flush-disk-cache-on-fsync +++ a/fs/block_dev.c @@ -405,7 +405,17 @@ static loff_t block_llseek(struct file * static int block_fsync(struct file *filp, struct dentry *dentry, int datasync) { - return sync_blockdev(I_BDEV(filp->f_mapping->host)); + struct block_device *bdev = I_BDEV(filp->f_mapping->host); + int error; + + error = sync_blockdev(bdev); + if (error) + return error; + + error = blkdev_issue_flush(bdev, NULL); + if (error == -EOPNOTSUPP) + error = 0; + return error; } /* _ Patches currently in -mm which might be from hch@xxxxxx are origin.patch linux-next.patch avr32-convert-to-asm-generic-hardirqh.patch vfs-fix-vfs_rename_dir-for-fs_rename_does_d_move-filesystems.patch fs-remove-unneeded-dcache_unhashed-tricks.patch xtensa-convert-to-asm-generic-hardirqh.patch xfs-free-temporary-cursor-in-xfs_dialloc.patch mm-vmscan-change-comment-generic_file_write-to-__generic_file_aio_write.patch qnx4fs-remove-remains-of-the-defunct-write-support.patch lib-vsprintfc-add-%pu-to-print-uuid-guids.patch fs-xfs-xfs_log_recoverc-use-%pu-to-print-uuids.patch lib-unified-uuid-guid-definition.patch elf-kill-use_elf_core_dump.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html