Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2255365pxb; Mon, 18 Jan 2021 12:29:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIAb3bosFCwgtOK5yMlinIEDASFXQhqoqG6U1saYg2q7eDdVNvK3kiNCOekkM55Q77UJUv X-Received: by 2002:a50:ef04:: with SMTP id m4mr871212eds.283.1611001750530; Mon, 18 Jan 2021 12:29:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611001750; cv=none; d=google.com; s=arc-20160816; b=KBd6GAgiZ+3zGgBcSbo5Z+eg/+oqi5ZypAiPWMIWdSO9404iY+7lhfDwqPssEA7V0o p1myYQPu83nS46mju1FrREFRO1Pen11p45cB8cx7hQ4pl28jK7m0ynCb16EempVsR3RJ i9RwfFQlGaAJqg/j/ptHQctWx2HdDmCkKIox46irDgngrZFAgczaAx08aFaicVQS6zg7 MY8s2oJYAxTKL8UWdejb6zCjQvYkSSrbvU7J7ZsReJCuujmc4aR4DzCqYFzT6X3/nJuQ mEDSSBCKVTOq/tsj6t+ix4kWW/yCSCMh1cJX1nHp7+tD8n0+e37Au4yAqWa04TgJi2cv axRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=omkE1Y1ScTMFf6AZSsGot31wxHG4QWt/bTsQ+E/cst8=; b=Q2uu8ockprkMJVkoAquLQKJAxz4vfimBqGBfNcwJ5Y6SUc4c1T5uCo/S3AyYXcbN+9 jZbcNImkw5UBmi6pYVD+QYW412GWcIDVubFLHkuRrmsFrefH8MLpcZzFfmjYxfsSFhG6 pjq0TxH6SI/d+eNMVPx3K/czJhg6l20xMssTairrLsew71ULcvzoO6VZ+mFfoF0DIB21 MWPVAAJAUzi1Dd23SkIaldGjomPybvhak9Qr9INh14kNNnbAF0lqAodF7cRV05vXBoXn OVeZW4PwJjLp4/icwHYErCAuJB3FMhPrND+mt+0FbdzzmmGi/K2eEbsDm/u8IS6mNZrJ tmBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b21si8200710ejz.649.2021.01.18.12.28.47; Mon, 18 Jan 2021 12:29:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437901AbhARU1F (ORCPT + 99 others); Mon, 18 Jan 2021 15:27:05 -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,,,