linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/filemap: pass inclusive 'end_byte' parameter to filemap_range_has_page
@ 2019-01-28 12:31 zhengbin
  2019-01-28 12:31 ` zhengbin
  2019-01-28 20:18 ` Matthew Wilcox
  0 siblings, 2 replies; 6+ messages in thread
From: zhengbin @ 2019-01-28 12:31 UTC (permalink / raw)
  To: akpm, willy, darrick.wong, amir73il, david, hannes, jrdr.linux,
	hughd, linux-mm
  Cc: houtao1, yi.zhang, zhengbin13

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

Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 mm/filemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 9f5e323..a236bf3 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3081,7 +3081,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,
--
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-01 19:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-28 12:31 [PATCH] mm/filemap: pass inclusive 'end_byte' parameter to filemap_range_has_page zhengbin
2019-01-28 12:31 ` zhengbin
2019-01-28 20:18 ` Matthew Wilcox
2019-02-01  7:43   ` Christoph Hellwig
2019-02-01 15:14     ` Jens Axboe
2019-02-01 19:32     ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).