提交 cbdedc8b 编写于 作者: Z zhengbin 提交者: Xie XiuQi

mm/filemap: pass inclusive 'end_byte' parameter to filemap_range_has_page

mainline inclusion
from mainline-5.0
commit 35f12f0f
category: bugfix
bugzilla: 11621
CVE: NA

------------------------------------------------

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: Nzhengbin <zhengbin13@huawei.com>
Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: NMatthew Wilcox <willy@infradead.org>
Acked-by: NChristoph 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Nzhong jiang <zhongjiang@huawei.com>
Reviewed-by: NJing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5e3969a4
...@@ -3034,7 +3034,7 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from) ...@@ -3034,7 +3034,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册