]> git.karo-electronics.de Git - karo-tx-linux.git/commit
direct-io: Fix boundary block handling
authorJan Kara <jack@suse.cz>
Tue, 26 Mar 2013 23:24:22 +0000 (10:24 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 4 Apr 2013 06:12:04 +0000 (17:12 +1100)
commit5986f517de2c2609a4ffbb393a0133d2a65f091e
tree0e7df97523437182d20a96e684d1985e0fb6abc9
parent92be3e105c1a72da4f103993826f880c8880507d
direct-io: Fix boundary block handling

When we read/write a file sequentially, we will read/write not only the
data blocks but also the indirect blocks that may not be physically
adjacent to the data blocks.  So filesystems set the BH_Boundary flag to
submit the previous I/O before reading/writing an indirect block.

However the generic direct IO code mishandles buffer_boundary(), setting
sdio->boundary before each submit_page_section() call which results in
sending only one page bios as underlying code thinks this page is the last
in the contiguous extent.  So fix the problem by setting sdio->boundary
only if the current page is really the last one in the mapped extent.

Signed-off-by: Jan Kara <jack@suse.cz>
Reported-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/direct-io.c