linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] fs/splice: add missing callback for inaccessible pages
@ 2020-04-28 22:50 Claudio Imbrenda
  2020-04-29  0:25 ` Dave Hansen
  2020-04-29 16:07 ` Dave Hansen
  0 siblings, 2 replies; 18+ messages in thread
From: Claudio Imbrenda @ 2020-04-28 22:50 UTC (permalink / raw)
  To: akpm, jack, kirill
  Cc: borntraeger, david, aarcange, linux-mm, frankja, sfr, jhubbard,
	linux-kernel, linux-s390, dave.hansen, peterz,
	sean.j.christopherson

If a page is inaccesible and it is used for things like sendfile, then
the content of the page is not always touched, and can be passed
directly to a driver, causing issues.

This patch fixes the issue by adding a call to arch_make_page_accessible
in page_cache_pipe_buf_confirm; this fixes the issue.

Fixes: f28d43636d6f ("mm/gup/writeback: add callbacks for inaccessible pages")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
 fs/splice.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/splice.c b/fs/splice.c
index 4735defc46ee..f026e0ce9acd 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -106,6 +106,9 @@ static int page_cache_pipe_buf_confirm(struct pipe_inode_info *pipe,
 	struct page *page = buf->page;
 	int err;
 
+	if (arch_make_page_accessible(page))
+		return -EIO;
+
 	if (!PageUptodate(page)) {
 		lock_page(page);
 
-- 
2.25.4



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

end of thread, other threads:[~2020-04-30 22:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 22:50 [PATCH v1 1/1] fs/splice: add missing callback for inaccessible pages Claudio Imbrenda
2020-04-29  0:25 ` Dave Hansen
2020-04-29 16:07 ` Dave Hansen
2020-04-29 17:31   ` Christian Borntraeger
2020-04-29 17:55     ` Dave Hansen
2020-04-29 22:53       ` Claudio Imbrenda
2020-04-29 23:52         ` Dave Hansen
2020-04-30 17:19           ` Claudio Imbrenda
2020-04-30 17:30             ` Dave Hansen
2020-04-30 18:12   ` Christian Borntraeger
2020-04-30 19:02     ` Christian Borntraeger
2020-04-30 19:54       ` Christian Borntraeger
2020-04-30 22:26         ` John Hubbard
2020-04-30 19:32     ` Dave Hansen
2020-04-30 19:38       ` Christian Borntraeger
2020-04-30 20:01         ` Dave Hansen
2020-04-30 20:03           ` Christian Borntraeger
2020-04-30 19:45       ` Christian Borntraeger

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).