ocfs2: do not use ocfs2_zero_extend during direct IO
authorJoseph Qi <joseph.qi@huawei.com>
Tue, 14 Apr 2015 22:43:13 +0000 (15:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Apr 2015 23:48:57 +0000 (16:48 -0700)
commit14a5275d8c31ba24832f45eeb2469e835ded660d
tree91f7ea53e0fcfa73088ca9b71af6aac4610b5321
parent37a8d89aee2a5b58812e19520d96632efe987f54
ocfs2: do not use ocfs2_zero_extend during direct IO

In ocfs2_direct_IO_write, we use ocfs2_zero_extend to zero allocated
clusters in case of cluster not aligned.  But ocfs2_zero_extend uses page
cache, this may happen that it clears the data which blockdev_direct_IO
has already written.

We should use blkdev_issue_zeroout instead of ocfs2_zero_extend during
direct IO.

So fix this issue by introducing ocfs2_direct_IO_zero_extend and
ocfs2_direct_IO_extend_no_holes.

Reported-by: Yiwen Jiang <jiangyiwen@huawei.com>
Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Tested-by: Yiwen Jiang <jiangyiwen@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/aops.c