diff options
author | zhengbin <[email protected]> | 2019-03-05 15:44:21 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2019-03-05 21:07:16 -0800 |
commit | 35f12f0f5c3bbd60caba89351f45c8eef8ffd423 (patch) | |
tree | 09ad6b0d6a943a7a45849a45339b93bac35e4b4c | |
parent | d71e53cee7c2e553b85c572e76da778a93d32135 (diff) |
mm/filemap: pass inclusive 'end_byte' parameter to filemap_range_has_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: 6be96d3ad34a ("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]>
-rw-r--r-- | mm/filemap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 935fbc29aeb1..e59fdecdab74 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -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, |