]> Git Repo - linux.git/commitdiff
jffs2: Hook up splice_write callback
authorJoel Stanley <[email protected]>
Tue, 30 Mar 2021 13:45:37 +0000 (00:15 +1030)
committerRichard Weinberger <[email protected]>
Thu, 15 Apr 2021 20:01:14 +0000 (22:01 +0200)
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
36e2c7421f02 ("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: [email protected]
Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")
Signed-off-by: Joel Stanley <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Tested-by: Lei YU <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
fs/jffs2/file.c

index f8fb89b10227ce54d7267da042a07233bd9b331c..4fc8cd698d1a4ac0b4f13b694a0c63c214c276ce 100644 (file)
@@ -57,6 +57,7 @@ const struct file_operations jffs2_file_operations =
        .mmap =         generic_file_readonly_mmap,
        .fsync =        jffs2_fsync,
        .splice_read =  generic_file_splice_read,
+       .splice_write = iter_file_splice_write,
 };
 
 /* jffs2_file_inode_operations */
This page took 0.059075 seconds and 4 git commands to generate.