Skip to content

Commit

Permalink
mm/filemap: pass inclusive 'end_byte' parameter to filemap_range_has_…
Browse files Browse the repository at this point in the history
…page

The 'end_byte' parameter of filemap_range_has_page is required to be
inclusive, so follow the rule.

Link: http://lkml.kernel.org/r/[email protected]
Fixes: 6be96d3 ("fs: return if direct I/O will trigger writeback")
Signed-off-by: zhengbin <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Reviewed-by: Matthew Wilcox <[email protected]>
Acked-by: Christoph Hellwig <[email protected]>
Cc: "Darrick J. Wong" <[email protected]>
Cc: Amir Goldstein <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Hou Tao <[email protected]>
Cc: zhangyi (F) <[email protected]>
Cc: Jan Kara <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
zhengbin13 authored and torvalds committed Mar 6, 2019
1 parent d71e53c commit 35f12f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3071,7 +3071,7 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from)
if (iocb->ki_flags & IOCB_NOWAIT) {
/* If there are pages to writeback, return */
if (filemap_range_has_page(inode->i_mapping, pos,
pos + write_len))
pos + write_len - 1))
return -EAGAIN;
} else {
written = filemap_write_and_wait_range(mapping, pos,
Expand Down

0 comments on commit 35f12f0

Please sign in to comment.