linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: Do not check for valid page->mapping in page_cache_pipe_buf_confirm
@ 2016-05-26  3:24 Abhi Das
  2016-06-28 14:23 ` Abhijith Das
  0 siblings, 1 reply; 2+ messages in thread
From: Abhi Das @ 2016-05-26  3:24 UTC (permalink / raw)
  To: cluster-devel, linux-kernel, linux-fsdevel
  Cc: Abhi Das, Miklos Szeredi, Jens Axboe, Al Viro

If the page is truncated after being spliced into the pipe, it's
probably not invalid.

For filesystems that invalidate pages, we used to return -ENODATA
even though the data is there, it's just possibly different from
what was spliced into the pipe. We shouldn't have to throw away
the buffer or return error in this case.

Signed-off-by: Abhi Das <adas@redhat.com>
CC: Miklos Szeredi <mszeredi@redhat.com>
CC: Jens Axboe <axboe@fb.com>
CC: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/splice.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/fs/splice.c b/fs/splice.c
index dd9bf7e..b9899b99 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -106,15 +106,6 @@ static int page_cache_pipe_buf_confirm(struct pipe_inode_info *pipe,
 		lock_page(page);
 
 		/*
-		 * Page got truncated/unhashed. This will cause a 0-byte
-		 * splice, if this is the first page.
-		 */
-		if (!page->mapping) {
-			err = -ENODATA;
-			goto error;
-		}
-
-		/*
 		 * Uh oh, read-error from disk.
 		 */
 		if (!PageUptodate(page)) {
-- 
2.4.3

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

* Re: [PATCH] fs: Do not check for valid page->mapping in page_cache_pipe_buf_confirm
  2016-05-26  3:24 [PATCH] fs: Do not check for valid page->mapping in page_cache_pipe_buf_confirm Abhi Das
@ 2016-06-28 14:23 ` Abhijith Das
  0 siblings, 0 replies; 2+ messages in thread
From: Abhijith Das @ 2016-06-28 14:23 UTC (permalink / raw)
  To: cluster-devel, linux-kernel, linux-fsdevel
  Cc: Miklos Szeredi, Jens Axboe, Al Viro

----- Original Message -----
> From: "Abhi Das" <adas@redhat.com>
> To: cluster-devel@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
> Cc: "Abhi Das" <adas@redhat.com>, "Miklos Szeredi" <mszeredi@redhat.com>, "Jens Axboe" <axboe@fb.com>, "Al Viro"
> <viro@zeniv.linux.org.uk>
> Sent: Wednesday, May 25, 2016 10:24:45 PM
> Subject: [PATCH] fs: Do not check for valid page->mapping in page_cache_pipe_buf_confirm
> 
> If the page is truncated after being spliced into the pipe, it's
> probably not invalid.
> 
> For filesystems that invalidate pages, we used to return -ENODATA
> even though the data is there, it's just possibly different from
> what was spliced into the pipe. We shouldn't have to throw away
> the buffer or return error in this case.
> 
> Signed-off-by: Abhi Das <adas@redhat.com>
> CC: Miklos Szeredi <mszeredi@redhat.com>
> CC: Jens Axboe <axboe@fb.com>
> CC: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  fs/splice.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/fs/splice.c b/fs/splice.c
> index dd9bf7e..b9899b99 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -106,15 +106,6 @@ static int page_cache_pipe_buf_confirm(struct
> pipe_inode_info *pipe,
>  		lock_page(page);
>  
>  		/*
> -		 * Page got truncated/unhashed. This will cause a 0-byte
> -		 * splice, if this is the first page.
> -		 */
> -		if (!page->mapping) {
> -			err = -ENODATA;
> -			goto error;
> -		}
> -
> -		/*
>  		 * Uh oh, read-error from disk.
>  		 */
>  		if (!PageUptodate(page)) {
> --
> 2.4.3
> 
> 

Hi Jens/Al,

Any comments on this patch? FWIW, I've done some testing on GFS2 w/ this patch
and it seems to be holding up ok. The test is designed to verify writes using
splice reads and even if the pages were truncated, the data read in from the
spliced pipe looks consistent with what was expected.

Cheers!
--Abhi

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

end of thread, other threads:[~2016-06-28 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-26  3:24 [PATCH] fs: Do not check for valid page->mapping in page_cache_pipe_buf_confirm Abhi Das
2016-06-28 14:23 ` Abhijith Das

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