From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E38E3C433DB for ; Mon, 18 Jan 2021 20:27:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F99322D71 for ; Mon, 18 Jan 2021 20:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437994AbhARU1W (ORCPT ); Mon, 18 Jan 2021 15:27:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437983AbhARU0s (ORCPT ); Mon, 18 Jan 2021 15:26:48 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 752DEC061573 for ; Mon, 18 Jan 2021 12:26:08 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1l1aIj-0035kQ-Ag; Mon, 18 Jan 2021 19:34:57 +0000 Date: Mon, 18 Jan 2021 19:34:57 +0000 From: Al Viro To: Christoph Hellwig Cc: Johannes Berg , Oliver Giles , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Linus Torvalds , Al Viro Subject: Re: Splicing to/from a tty Message-ID: <20210118193457.GA736435@zeniv-ca> References: <20210118085311.GA2735@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210118085311.GA2735@lst.de> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 09:53:11AM +0100, Christoph Hellwig wrote: > On Sat, Jan 16, 2021 at 05:46:33PM +0100, Johannes Berg wrote: > > > For my case, I attempted to instead implement splice_write and > > > splice_read in tty_fops; I managed to get splice_write working calling > > > ld->ops->write, but splice_read is not so simple because the > > > tty_ldisc_ops read method expects a userspace buffer. So I cannot see > > > how to implement this without either (a) using set_fs, or (b) > > > implementing iter ops on all line disciplines. > > > > > > Is splice()ing between a tty and a pipe worth supporting at all? Not a > > > big deal for my use case at least, but it used to work. > > > > Is it even strictly related to the tty? > > > > I was just now looking into why my cgit/fcgi/nginx setup no longer > > works, and the reason is getting -EINVAL from sendfile() when the input > > is a file and the output is a pipe(). > > Yes, pipes do not support ->splice_write currenly. I think just wiring > up iter_file_splice_write would work. Al? I'd rather have sendfile(2) do what splice(2) does and handle pipes directly. Let me take a look,,,