Commit 35f12f0f authored by zhengbin's avatar zhengbin Committed by Linus Torvalds

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/1548678679-18122-1-git-send-email-zhengbin13@huawei.com
Fixes: 6be96d3a ("fs: return if direct I/O will trigger writeback")
Signed-off-by: default avatarzhengbin <zhengbin13@huawei.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarMatthew Wilcox <willy@infradead.org>
Acked-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Hou Tao <houtao1@huawei.com>
Cc: zhangyi (F) <yi.zhang@huawei.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d71e53ce
...@@ -3071,7 +3071,7 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from) ...@@ -3071,7 +3071,7 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from)
if (iocb->ki_flags & IOCB_NOWAIT) { if (iocb->ki_flags & IOCB_NOWAIT) {
/* If there are pages to writeback, return */ /* If there are pages to writeback, return */
if (filemap_range_has_page(inode->i_mapping, pos, if (filemap_range_has_page(inode->i_mapping, pos,
pos + write_len)) pos + write_len - 1))
return -EAGAIN; return -EAGAIN;
} else { } else {
written = filemap_write_and_wait_range(mapping, pos, written = filemap_write_and_wait_range(mapping, pos,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment