nilfs2: fix missed-sync issue for do_sync_mapping_range()
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tue, 7 Apr 2009 02:01:38 +0000 (19:01 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Apr 2009 15:31:15 +0000 (08:31 -0700)
commitf30bf3e40f80ef50c17f55271deae3abc03e793e
tree2e6d69611d1443688c1a79c5e5aed60cf38672e7
parent9ff05123e3bfbb1d2b68ba1d9bf1f7d1dffc1453
nilfs2: fix missed-sync issue for do_sync_mapping_range()

Chris Mason pointed out that there is a missed sync issue in
nilfs_writepages():

On Wed, 17 Dec 2008 21:52:55 -0500, Chris Mason wrote:
> It looks like nilfs_writepage ignores WB_SYNC_NONE, which is used by
> do_sync_mapping_range().

where WB_SYNC_NONE in do_sync_mapping_range() was replaced with
WB_SYNC_ALL by Nick's patch (commit:
ee53a891f47444c53318b98dac947ede963db400).

This fixes the problem by letting nilfs_writepages() write out the log of
file data within the range if sync_mode is WB_SYNC_ALL.

This involves removal of nilfs_file_aio_write() which was previously
needed to ensure O_SYNC sync writes.

Cc: Chris Mason <chris.mason@oracle.com>
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>
fs/nilfs2/file.c
fs/nilfs2/inode.c
fs/nilfs2/segment.c
fs/nilfs2/segment.h