Skip to contentSkip to conversation

nilfs2: make splice write available again

PATCH Applied Ryusuke Konishi 1 participant 2 messages Feb 8, 2021 NILFS2 filesystem

lore
Share & tools
lore

Ryusuke Konishi

author maintainer
#0 lore raw

PATCH 1/1 nilfs2: make splice write available again

From: Joachim Henke <[email protected]>

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.

---
 fs/nilfs2/file.c | 1 +
 1 file changed, 1 insertion(+)
fs/nilfs2/file.c +1 -0
index 64bc81363c6c..e1bd592ce700 100644
@@ -141,6 +141,7 @@ static int nilfs_file_mmap(struct file *file, struct vm_area_struct *vma)
 	/* .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 = {
Signature · 1 line
1.8.3.1
author maintainer
#1 lore raw

Hi Andrew,

Please send this to upstream. This fixes a regression of splice() on nilfs2.

Thanks,
Ryusuke Konishi

Quoted 33 lines · Ryusuke Konishi

From: Joachim Henke <[email protected]>

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.

---
 fs/nilfs2/file.c | 1 +
 1 file changed, 1 insertion(+)
fs/nilfs2/file.c +1 -1
index 64bc81363c6c..e1bd592ce700 100644
@@ -141,6 +141,7 @@ static int nilfs_file_mmap(struct file *file, struct vm_area_struct *vma)
        /* .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 = {
--

1.8.3.1