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 AD68DC433E6 for ; Wed, 20 Jan 2021 19:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5847A23403 for ; Wed, 20 Jan 2021 19:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392409AbhATTM2 (ORCPT ); Wed, 20 Jan 2021 14:12:28 -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...