Skip to content

Commit 643243e

Browse files
shenkigregkh
authored andcommitted
jffs2: Hook up splice_write callback
commit 42984af upstream. overlayfs using jffs2 as the upper filesystem would fail in some cases since moving to v5.10. The test case used was to run 'touch' on a file that exists in the lower fs, causing the modification time to be updated. It returns EINVAL when the bug is triggered. A bisection showed this was introduced in v5.9-rc1, with commit 36e2c74 ("fs: don't allow splice read/write without explicit ops"). Reverting that commit restores the expected behaviour. Some digging showed that this was due to jffs2 lacking an implementation of splice_write. (For unknown reasons the warn_unsupported that should trigger was not displaying any output). Adding this patch resolved the issue and the test now passes. Cc: stable@vger.kernel.org Fixes: 36e2c74 ("fs: don't allow splice read/write without explicit ops") Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Christoph Hellwig <hch@lst.de> Tested-by: Lei YU <yulei.sh@bytedance.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 72c282b commit 643243e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/jffs2/file.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const struct file_operations jffs2_file_operations =
5757
.mmap = generic_file_readonly_mmap,
5858
.fsync = jffs2_fsync,
5959
.splice_read = generic_file_splice_read,
60+
.splice_write = iter_file_splice_write,
6061
};
6162

6263
/* jffs2_file_inode_operations */

0 commit comments

Comments
 (0)