Message ID | 20230727161016.169066-2-dhowells@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/2] shmem: Fix splice of a missing page | expand |
On Thu, 27 Jul 2023 17:10:15 +0100 David Howells <dhowells@redhat.com> wrote: > Fix shmem_splice_read() to splice only part of the partial page at the end > of a splice and not all of it. > > This can be seen by splicing from a tmpfs file that's not a multiple of > PAGE_SIZE in size. Without this fix, it splices extra data to round up to > PAGE_SIZE. This is already in mm-unstable (and hence linux-next) via Hugh's "shmem: minor fixes to splice-read implementation" (https://lkml.kernel.org/r/32c72c9c-72a8-115f-407d-f0148f368@google.com)
On Thu, 27 Jul 2023, David Howells wrote: > Andrew Morton <akpm@linux-foundation.org> wrote: > > > This is already in mm-unstable (and hence linux-next) via Hugh's > > "shmem: minor fixes to splice-read implementation" > > (https://lkml.kernel.org/r/32c72c9c-72a8-115f-407d-f0148f368@google.com) > > And I've already reviewed it:-) I'm not sure whether that ":-)" is implying (good-natured) denial. You reviewed the original on 17 April, when Jens took it into his tree; then it vanished in a rewrite, and you didn't respond when I asked about that on 28 June; then you were Cc'ed when I sent it to Andrew on 23 July (where I explained about dropping two mods but keeping your Reviewed-by). This version that Andrew has in mm-unstable includes the hwpoison fix that we agreed on before, in addition to the len -> part fix. Hugh
Hugh Dickins <hughd@google.com> wrote: > On Thu, 27 Jul 2023, David Howells wrote: > > Andrew Morton <akpm@linux-foundation.org> wrote: > > > > > This is already in mm-unstable (and hence linux-next) via Hugh's > > > "shmem: minor fixes to splice-read implementation" > > > (https://lkml.kernel.org/r/32c72c9c-72a8-115f-407d-f0148f368@google.com) > > > > And I've already reviewed it:-) > > I'm not sure whether that ":-)" is implying (good-natured) denial. I've reviewed it, and the review still seems good. > You reviewed the original on 17 April, when Jens took it into his tree; > then it vanished in a rewrite, and you didn't respond when I asked about > that on 28 June; I missed it in the rush to try and get everything debugged during the merge window prior to going on holiday. > then you were Cc'ed when I sent it to Andrew on 23 July (where I explained > about dropping two mods but keeping your Reviewed-by). Hmmm... I don't find that one in my inbox. > This version that Andrew has in mm-unstable includes the hwpoison fix > that we agreed on before, in addition to the len -> part fix. Ok. David
diff --git a/mm/shmem.c b/mm/shmem.c index 2f2e0e618072..0164cccdcd71 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2841,7 +2841,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos, folio_put(folio); folio = NULL; } else { - n = splice_zeropage_into_pipe(pipe, *ppos, len); + n = splice_zeropage_into_pipe(pipe, *ppos, part); } if (!n)
Fix shmem_splice_read() to splice only part of the partial page at the end of a splice and not all of it. This can be seen by splicing from a tmpfs file that's not a multiple of PAGE_SIZE in size. Without this fix, it splices extra data to round up to PAGE_SIZE. Fixes: bd194b187115 ("shmem: Implement splice-read") Signed-off-by: David Howells <dhowells@redhat.com> cc: Hugh Dickins <hughd@google.com> cc: Christoph Hellwig <hch@lst.de> cc: Jens Axboe <axboe@kernel.dk> cc: Al Viro <viro@zeniv.linux.org.uk> cc: John Hubbard <jhubbard@nvidia.com> cc: David Hildenbrand <david@redhat.com> cc: Matthew Wilcox <willy@infradead.org> cc: Chuck Lever <chuck.lever@oracle.com> cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)