linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* About whether we should support the alignment in the generic_file_splice_read() ?
@ 2019-11-29  7:50 Jason Xing
  0 siblings, 0 replies; only message in thread
From: Jason Xing @ 2019-11-29  7:50 UTC (permalink / raw)
  To: viro; +Cc: linux-xfs, linux-fsdevel, linux-kernel

Hi all,

Sorry to send this email to you all. I recently noticed there're some
incompatibilities existing in the generic_file_splice_read() function
between 3.X and 4.X kernel. The result will goes wrong if we're using
sendfile() with unaligned offset in 4.X/5.X kernel. But if we do the
same in 3.X kernel, it will surely return success.

Here is the call trace:
1. Using sendfile() with unaligned offset
2. Then it runs into the kernel:
sendfile64()->do_sendfile()->do_splice_direct()->splice_direct_to_actor()->do_splice_to()->splice_read()
3. splice_read() calls the __generic_file_splice_read() in 3.X kernel,
generic_file_splice_read() in 4.X kernel.

In 3.X kernel, this function handles the alignment by using the
PAGE_SHIFT and PAGE_MASK. However, after applying this
commit(82c156f853840645604acd7c2cebcb75ed1b6652) the 4.X no longer
supports the unaligned data.

I'm wondering should we add the alignment process code back again?
Does anyone have idea about why this part got removed? Any information
and suggestions are welcome:-)

Thanks,
Jason

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-29  7:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29  7:50 About whether we should support the alignment in the generic_file_splice_read() ? Jason Xing

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