]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: simplify file splice
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 14 Dec 2020 14:26:14 +0000 (15:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:12 +0000 (11:40 +0200)
commit0cb8fe24e5249b9872d85bd0be3ff5c1d6d84e92
tree830bf2f9c1e44e1fbf71995d13c51ec26bf41951
parent2f3b6ae1b8e0f4b1deb212f870dffd453a674f1e
ovl: simplify file splice

commit 82a763e61e2b601309d696d4fa514c77d64ee1be upstream.

generic_file_splice_read() and iter_file_splice_write() will call back into
f_op->iter_read() and f_op->iter_write() respectively.  These already do
the real file lookup and cred override.  So the code in ovl_splice_read()
and ovl_splice_write() is redundant.

In addition the ovl_file_accessed() call in ovl_splice_write() is
incorrect, though probably harmless.

Fix by calling generic_file_splice_read() and iter_file_splice_write()
directly.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
[reported to resolve issues with 1a980b8cbf00 ("ovl: add splice file read write helper")]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/file.c