* 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, back to index
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
Linux-XFS Archive on lore.kernel.org
Archives are clonable:
git clone --mirror https://lore.kernel.org/linux-xfs/0 linux-xfs/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 linux-xfs linux-xfs/ https://lore.kernel.org/linux-xfs \
linux-xfs@vger.kernel.org
public-inbox-index linux-xfs
Example config snippet for mirrors
Newsgroup available over NNTP:
nntp://nntp.lore.kernel.org/org.kernel.vger.linux-xfs
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git