summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSung-hun Kim <sfoon.kim@samsung.com>2023-03-14 02:37:07 +0100
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-03-19 18:16:21 +0100
commite400be674a1a40e9dcb2e95f84d6c1fd2d88f31d (patch)
tree72c1c5db82a8bbc9fc2cedaf7c387dbfcd214cfe /kernel/trace/trace.c
parentftrace: Set direct_ops storage-class-specifier to static (diff)
downloadlinux-e400be674a1a40e9dcb2e95f84d6c1fd2d88f31d.tar.xz
linux-e400be674a1a40e9dcb2e95f84d6c1fd2d88f31d.zip
tracing: Make splice_read available again
Since the commit 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") is applied to the kernel, splice() and sendfile() calls on the trace file (/sys/kernel/debug/tracing /trace) return EINVAL. This patch restores these system calls by initializing splice_read in file_operations of the trace file. This patch only enables such functionalities for the read case. Link: https://lore.kernel.org/linux-trace-kernel/20230314013707.28814-1-sfoon.kim@samsung.com Cc: stable@vger.kernel.org Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to '')
-rw-r--r--kernel/trace/trace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index fbb602a8b64b..4e9a7a952025 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5164,6 +5164,8 @@ loff_t tracing_lseek(struct file *file, loff_t offset, int whence)
static const struct file_operations tracing_fops = {
.open = tracing_open,
.read = seq_read,
+ .read_iter = seq_read_iter,
+ .splice_read = generic_file_splice_read,
.write = tracing_write_stub,
.llseek = tracing_lseek,
.release = tracing_release,