Skip to contentSkip to conversation

nilfs2: make splice write available again

PATCH In review [email protected] 2 participants 2 messages Jan 23, 2021 3 messages not in the archive NILFS2 filesystem

lore
Share & tools
lore
#2 lore raw

PATCH 1/1 nilfs2: make splice write available again

In reply to a message not in the archive

Since 5.10, splice() or sendfile() to NILFS2 return EINVAL. This was probably 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.

---
 fs/nilfs2/file.c | 1 +
 1 file changed, 1 insertion(+)
fs/nilfs2/file.c +1 -0
index 64bc81363c6cc..4c7a662047513 100644
@@ -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 = {
#4 lore raw
In reply to a message not in the archive

Hi,

Thank you for quick patch submission. It looks good at a glance.
I will check the details of the change and will try testing.

Thanks,
Ryusuke Konishi

Quoted 25 lines · On Sat, Jan 23, 2021 at 11:39 PM <[email protected]…

Since 5.10, splice() or sendfile() to NILFS2 return EINVAL. This was probably 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.

---
 fs/nilfs2/file.c | 1 +
 1 file changed, 1 insertion(+)
fs/nilfs2/file.c +1 -0
index 64bc81363c6cc..4c7a662047513 100644
@@ -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 = {