Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp701818pxb; Wed, 20 Jan 2021 19:10:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIQn2z1bVLlNjxnJCH1QMbpR1DI5sJpEPYKi3C1AcX7ZPqF25T2rVIRS4tuq7nSraojy+w X-Received: by 2002:a17:906:36d4:: with SMTP id b20mr7769219ejc.144.1611198609499; Wed, 20 Jan 2021 19:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611198609; cv=none; d=google.com; s=arc-20160816; b=t7/8cdGyJWCDJ1W3VUMWaa6wtdhKFa7WQDDjuFAMrsQinQ/PF1C9msA6IMZQ4I34Hn mKvKkYA3vziU8idWGREutIW0xcDOzV2CHgwwcP12xlLfdwZ/Xglq2yPcyc4f6Q6ngBMe oG+8uWfZMBgLdEtkCuAF3WqSOwcSzpPS/hs1nRbuCySAhGNMiifBJFSfB9ejkTemfZ3d SUHRe2zzdFpsBthbEaEHe82uiwFvlebPDTSAKSaSQZLlgpe8HOlFi8ix0cCIEGjDjJV1 5kxMXrKAAK7Gz2u9uWzcckUFRaM1waOwatAz5SdUjxBAcofiDUDCVKED4gqGG0p/M988 xelQ== 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=4zbRxwEGvjHxBw6NABXNjM/8JgKLzr0C0DbWmUA2J3s=; b=u/WbR/4ZFpNbQXWzNj+at+iyCYredNAG7lbcJh7bIeUBT61uCrzV7t7zGNrNRw/0Gj sDiu5mXfpwptERxltHZBWXSRYQyb53HzzSV9eSRBztTHs+xuPOOTFUThHTK8tkDA/+9+ +vzNGeYRyE00+U5QQueQsiKsXagAvFFQKCYOed0d8LITtQGs4gvYn4Cx0aOun9N325bM jAFpY0/7FD8AwYmAwBK9ZCvQb+hJh7iQXkITmCM+jYKfWzc6l8VCGV/SRmnEiwtiCVbC Hnq5rVB8UPuupqTPAMJrxSsYiYq2+xernVbpjJfrw6wFJvYihvkOxYaxJOK4uo6nDRcu aGCQ== 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 ga3si1266899ejc.601.2021.01.20.19.09.45; Wed, 20 Jan 2021 19:10:09 -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 S2392881AbhAUAPu (ORCPT + 99 others); Wed, 20 Jan 2021 19:15:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390992AbhATXQ4 (ORCPT ); Wed, 20 Jan 2021 18:16:56 -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 E6209C061349 for ; Wed, 20 Jan 2021 15:14:49 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1l2MgR-0041Ne-2x; Wed, 20 Jan 2021 23:14:39 +0000 Date: Wed, 20 Jan 2021 23:14:39 +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: <20210120231439.GE740243@zeniv-ca> References: <20210118085311.GA2735@lst.de> <20210118193457.GA736435@zeniv-ca> <20210118195400.GC736435@zeniv-ca> <20210120162608.GB740243@zeniv-ca> <20210120191116.GC740243@zeniv-ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 11:27:26AM -0800, Linus Torvalds wrote: > On Wed, Jan 20, 2021 at 11:11 AM Al Viro wrote: > > > > Why do we care about O_APPEND on anything without FMODE_PWRITE (including > > pipes), anyway? All writes there ignore position, after all... > > We shouldn't care. > > Also, I think we should try to move away from FMODE_PWRITE/PREAD > entirely, and use FMODE_STREAM as the primary "this thing doesn't have > a position at all". > > That's what gets rid of all the f_pos locking etc after all. The > FMODE_PWRITE/PREAD flags are I think legacy (although we do seem to > have the seq_file case that normally allows position on reads, but not > on writes, so we may need to keep all three bits). Umm... Why do we clear FMODE_PWRITE there, anyway? It came in commit 915a29ec1c5e34283a6231af1036114e4d612cb0 Author: Linus Torvalds Date: Sat Aug 7 02:08:23 2004 -0700 Add pread/pwrite support bits to match the lseek bit. This also removes the ESPIPE logic from pipes and seq_files, since the VFS layer now supports it. with seq_read() losing the special-cased pread prevention and seq_open() getting a ban on both pread and pwrite. With pread() support added in 2009, and (pointless) pwrite prohibition left in place.