From: zhengbin <zhengbin13@huawei.com>
To: akpm@linux-foundation.org, willy@infradead.org,
darrick.wong@oracle.com, amir73il@gmail.com, david@fromorbit.com,
hannes@cmpxchg.org, jrdr.linux@gmail.com, hughd@google.com,
linux-mm@kvack.org
Cc: houtao1@huawei.com, yi.zhang@huawei.com, zhengbin13@huawei.com
Subject: [PATCH] mm/filemap: pass inclusive 'end_byte' parameter to filemap_range_has_page
Date: Mon, 28 Jan 2019 20:31:19 +0800 [thread overview]
Message-ID: <1548678679-18122-1-git-send-email-zhengbin13@huawei.com> (raw)
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
WARNING: multiple messages have this Message-ID
From: zhengbin <zhengbin13@huawei.com>
To: <akpm@linux-foundation.org>, <willy@infradead.org>,
<darrick.wong@oracle.com>, <amir73il@gmail.com>,
<david@fromorbit.com>, <hannes@cmpxchg.org>,
<jrdr.linux@gmail.com>, <hughd@google.com>, <linux-mm@kvack.org>
Cc: <houtao1@huawei.com>, <yi.zhang@huawei.com>, <zhengbin13@huawei.com>
Subject: [PATCH] mm/filemap: pass inclusive 'end_byte' parameter to filemap_range_has_page
Date: Mon, 28 Jan 2019 20:31:19 +0800 [thread overview]
Message-ID: <1548678679-18122-1-git-send-email-zhengbin13@huawei.com> (raw)
Message-ID: <20190128123119.hxJ3xj0-StIvzrug1FRQtS_TGwXaNbBBx2WdEhys25o@z> (raw)
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
next reply other threads:[~2019-01-28 12:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-28 12:31 zhengbin [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1548678679-18122-1-git-send-email-zhengbin13@huawei.com \
--to=zhengbin13@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=amir73il@gmail.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=hannes@cmpxchg.org \
--cc=houtao1@huawei.com \
--cc=hughd@google.com \
--cc=jrdr.linux@gmail.com \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox