afs: Fix copy_file_range()
authorDavid Howells <dhowells@redhat.com>
Tue, 27 Oct 2020 09:39:04 +0000 (09:39 +0000)
committerDavid Howells <dhowells@redhat.com>
Tue, 27 Oct 2020 22:05:56 +0000 (22:05 +0000)
The prevention of splice-write without explicit ops made the
copy_file_write() syscall to an afs file (as done by the generic/112
xfstest) fail with EINVAL.

Fix by using iter_file_splice_write() for afs.

Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/afs/file.c

index 371d1488cc549db412a75045b7bfaf5b4d37204e..91225421ad3781df8d369782658a5304ec85c24b 100644 (file)
@@ -33,6 +33,7 @@ const struct file_operations afs_file_operations = {
        .write_iter     = afs_file_write,
        .mmap           = afs_file_mmap,
        .splice_read    = generic_file_splice_read,
+       .splice_write   = iter_file_splice_write,
        .fsync          = afs_fsync,
        .lock           = afs_lock,
        .flock          = afs_flock,