[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAARXrtn8bq9X5nDVYrGDxT4O8xWknb0nErG_SjZRUZbbk5nguA@mail.gmail.com>
Date: Wed, 31 Mar 2021 12:55:05 +0800
From: Lei YU <mine260309@...il.com>
To: Joel Stanley <joel@....id.au>
Cc: David Woodhouse <dwmw2@...radead.org>,
Richard Weinberger <richard@....at>,
Al Viro <viro@...iv.linux.org.uk>,
Kees Cook <keescook@...omium.org>,
Christoph Hellwig <hch@....de>,
"William A . Kennington III" <wak@...gle.com>,
linux-mtd@...ts.infradead.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] jffs2: Hook up splice_write callback
On Tue, Mar 30, 2021 at 9:45 PM Joel Stanley <joel@....id.au> wrote:
>
> 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.
>
> Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")
> Signed-off-by: Joel Stanley <joel@....id.au>
> ---
> fs/jffs2/file.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
> index f8fb89b10227..4fc8cd698d1a 100644
> --- a/fs/jffs2/file.c
> +++ b/fs/jffs2/file.c
> @@ -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 */
> --
> 2.30.2
>
Verified on g220a openbmc system that the patch fixes the issue.
Tested-by: Lei YU <yulei.sh@...edance.com>
Powered by blists - more mailing lists