nilfs2: make splice write available again
authorJoachim Henke <joachim.henke@t-systems.com>
Tue, 9 Feb 2021 21:42:36 +0000 (13:42 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Feb 2021 19:19:58 +0000 (11:19 -0800)
Since 5.10, splice() or sendfile() to NILFS2 return EINVAL.  This was
caused by commit 36e2c7421f02 ("fs: don't allow splice read/write
without explicit ops").

This patch initializes the splice_write field in file_operations, like
most file systems do, to restore the functionality.

Link: https://lkml.kernel.org/r/1612784101-14353-1-git-send-email-konishi.ryusuke@gmail.com
Signed-off-by: Joachim Henke <joachim.henke@t-systems.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Tested-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: <stable@vger.kernel.org> [5.10+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nilfs2/file.c

index 64bc81363c6cc0437dd4c757615af395c85b0475..e1bd592ce7001a28a2c18fdb7335e4d0d0b8a8ed 100644 (file)
@@ -141,6 +141,7 @@ const struct file_operations nilfs_file_operations = {
        /* .release     = nilfs_release_file, */
        .fsync          = nilfs_sync_file,
        .splice_read    = generic_file_splice_read,
+       .splice_write   = iter_file_splice_write,
 };
 
 const struct inode_operations nilfs_file_inode_operations = {