From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E0C21C03 for ; Mon, 20 Mar 2023 15:23:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 116A5C433EF; Mon, 20 Mar 2023 15:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1679325789; bh=SFLnrdPpk2zHTaeF0/fgroT11We0DBvjC2ruRHfABDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=juepg941k9/T7eq5JS0o+FAMCryn3LFtoO9G9AP3c0CxALNg1OD67v0uZcDg34sy/ hwCAVBO03liPngy06Lh7eZsACT09OYlF1S6scHofjlpfT9dcJ2CGfgC3gqbVjQYgES Snp2v9/CbOVy4+P9i1FMLEX5r26t6XMv7wnixzJ4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sung-hun Kim , "Steven Rostedt (Google)" Subject: [PATCH 6.1 143/198] tracing: Make splice_read available again Date: Mon, 20 Mar 2023 15:54:41 +0100 Message-Id: <20230320145513.559499694@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230320145507.420176832@linuxfoundation.org> References: <20230320145507.420176832@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Sung-hun Kim commit e400be674a1a40e9dcb2e95f84d6c1fd2d88f31d upstream. 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 Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace.c | 2 ++ 1 file changed, 2 insertions(+) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5120,6 +5120,8 @@ loff_t tracing_lseek(struct file *file, 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,