Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp461778pxb; Wed, 20 Jan 2021 11:13:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfaOFkl7lkR3/tRPz61xHrvHUKM5Dlyyze2ACVD9Z5KPVuMHxd2sHKO+BnZhfic9vV7HD9 X-Received: by 2002:a17:906:94d3:: with SMTP id d19mr6706379ejy.383.1611170014000; Wed, 20 Jan 2021 11:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611170013; cv=none; d=google.com; s=arc-20160816; b=Xvy1fAKYUF8Kw9HfyuVgpexwtq15w50Y1VUaI30NXWQDjJgzN1yx1WSCvaKdpYG0KI yBAHmKiyJZOyibCFhvQXjF7eTVPL5NpF4smCUsKwrB2NpTTN49xbsm9drcJbnl5beZ4M Nlz/bxuZYJsQVutnvl5NPkos7CmLKnJnsJWBKxa90vla3BfHv/sOSHKf1tJtprJpPrES gyAIWnsv8JfSRetcD6RZJjut6y6FGOSf+wBy6au3LC2CZXiqvs0sJqMpyCSQVD6ZyoIw 3DbSznckoIg2TVgaBkspr520AhaZKPnSPUgleZihUlQygEprapRR1SEA7zGRMPedq7D2 ucFA== 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=ErScbHFrQGbv1evm9uuVIWnm9qYVu9XQGEq7SugD6n4=; b=jffKqsm3grapU4l0JrHUSjkb+ChE6R/sNDweeCvsurIyGsoV/c/cWv6FRak0ty4w3q vkaro7gUx4rR2g/Juvf6mbnogSFZKKS6Jba8Ia2UE0EL8cp3yT2Du9MJEAYHS1nKkMTO wMvkJ8Bb6B3TYWsKiWlOlBr3LPPE65JZbiDO3EZ0WWhaYI2kVrRbFapDFh2qSvDIHC04 WMFs1EVLUC0u/r3/mdPiLix6W3ZUcUir5HLd0WCx8UNkWbCHArWGfYE674SWLqXKhLdc EcANOxfge+oOdh7wgJsJ+zse+o/Q0w4XiBPX4i2A0Ynm5mAH1B+aUuTFTwtJ1IKPkOjX qXlw== 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 mc7si923297ejb.172.2021.01.20.11.13.09; Wed, 20 Jan 2021 11:13:33 -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 S2392313AbhATTMY (ORCPT + 99 others); Wed, 20 Jan 2021 14:12:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728622AbhATTMQ (ORCPT ); Wed, 20 Jan 2021 14:12:16 -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 18606C061575 for ; Wed, 20 Jan 2021 11:11:33 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1l2Isu-003wj0-9O; Wed, 20 Jan 2021 19:11:16 +0000 Date: Wed, 20 Jan 2021 19:11:16 +0000 From: Al Viro To: Linus Torvalds Cc: Christoph Hellwig , Johannes Berg , Oliver Giles , Linux Kernel Mailing List , Greg Kroah-Hartman Subject: Re: Splicing to/from a tty Message-ID: <20210120191116.GC740243@zeniv-ca> References: <20210118085311.GA2735@lst.de> <20210118193457.GA736435@zeniv-ca> <20210118195400.GC736435@zeniv-ca> <20210120162608.GB740243@zeniv-ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210120162608.GB740243@zeniv-ca> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 04:26:08PM +0000, Al Viro wrote: > [1] yes, it is possible to have O_APPEND opened pipes - open a FIFO with > O_APPEND and you've got it. We are not quite consistent in handling > those - sendfile() to such is rejected, splice() is not. BTW, according to manpages of splice(2) and sendfile(2), we have EINVAL [snip] target file is opened in append mode [snip] and EINVAL out_fd has the O_APPEND flag set. This is not currently supported by sendfile(). However, splice(2) to FIFO opened with O_APPEND works just fine. So it doesn't match the manpage either. Why do we care about O_APPEND on anything without FMODE_PWRITE (including pipes), anyway? All writes there ignore position, after all...