]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs()
authorAndreas Rohner <andreas.rohner@gmx.net>
Mon, 13 Oct 2014 22:53:20 +0000 (15:53 -0700)
committerJiri Slaby <jslaby@suse.cz>
Wed, 3 Dec 2014 10:58:42 +0000 (11:58 +0100)
commit0d68992fb4250d00a906ee886ec541a6afeab066
tree7f21dc3c293f0ac8a571322a42c248edba51ba5c
parent79a423edd0ce526b6a28fd1fed4478d0ecda03e0
nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs()

commit e2c7617ae36b27f97643bfa08aabe27e630c1a76 upstream.

Under normal circumstances nilfs_sync_fs() writes out the super block,
which causes a flush of the underlying block device.  But this depends
on the THE_NILFS_SB_DIRTY flag, which is only set if the pointer to the
last segment crosses a segment boundary.  So if only a small amount of
data is written before the call to nilfs_sync_fs(), no flush of the
block device occurs.

In the above case an additional call to blkdev_issue_flush() is needed.
To prevent unnecessary overhead, the new flag nilfs->ns_flushed_device
is introduced, which is cleared whenever new logs are written and set
whenever the block device is flushed.  For convenience the function
nilfs_flush_device() is added, which contains the above logic.

Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nilfs2/file.c
fs/nilfs2/ioctl.c
fs/nilfs2/segment.c
fs/nilfs2/super.c
fs/nilfs2/the_nilfs.h