fs: 9p: add generic splice_read file operations
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 1 Dec 2020 13:54:09 +0000 (14:54 +0100)
committerDominique Martinet <asmadeus@codewreck.org>
Tue, 1 Dec 2020 16:53:49 +0000 (17:53 +0100)
commitcf03f316ad20dac16b5adae3f6dedd7d188c7f65
treef7e0f3d8ef6c4fe01b9bf750f5d105b56eaec0db
parentb65054597872ce3aefbc6a666385eabdf9e288da
fs: 9p: add generic splice_read file operations

The v9fs file operations were missing the splice_read operations, which
breaks sendfile() of files on such a filesystem. I discovered this while
trying to load an eBPF program using iproute2 inside a 'virtme' environment
which uses 9pfs for the virtual file system. iproute2 relies on sendfile()
with an AF_ALG socket to hash files, which was erroring out in the virtual
environment.

Since generic_file_splice_read() seems to just implement splice_read in
terms of the read_iter operation, I simply added the generic implementation
to the file operations, which fixed the error I was seeing. A quick grep
indicates that this is what most other file systems do as well.

Link: http://lkml.kernel.org/r/20201201135409.55510-1-toke@redhat.com
Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
fs/9p/vfs_file.c