From nobody Wed Feb 11 02:05:44 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA96AC7618E for ; Sun, 19 Mar 2023 16:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230431AbjCSQsS (ORCPT ); Sun, 19 Mar 2023 12:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbjCSQrx (ORCPT ); Sun, 19 Mar 2023 12:47:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D8351E9F2 for ; Sun, 19 Mar 2023 09:47:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3FC6EB80C8C for ; Sun, 19 Mar 2023 16:47:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F3A2C433B0; Sun, 19 Mar 2023 16:47:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1pdwCD-000JZV-0I; Sun, 19 Mar 2023 12:47:49 -0400 Message-ID: <20230319164748.909374812@goodmis.org> User-Agent: quilt/0.66 Date: Sun, 19 Mar 2023 12:46:49 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Sung-hun Kim Subject: [for-linus][PATCH 6/8] tracing: Make splice_read available again References: <20230319164643.513018619@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sung-hun Kim 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-sfo= on.kim@samsung.com Signed-off-by: Sung-hun Kim Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 2 ++ 1 file changed, 2 insertions(+) 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 =3D { .open =3D tracing_open, .read =3D seq_read, + .read_iter =3D seq_read_iter, + .splice_read =3D generic_file_splice_read, .write =3D tracing_write_stub, .llseek =3D tracing_lseek, .release =3D tracing_release, --=20 2.39.1