Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp795856ybg; Sun, 26 Jul 2020 22:49:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVDtCW0bxBRFVLPO2nExc8eMIRABKNlJt9dFzB3a5nK5L86sQRfBSN9rg30Ngl3U+x2X3c X-Received: by 2002:a17:906:f905:: with SMTP id lc5mr3792488ejb.340.1595828965257; Sun, 26 Jul 2020 22:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595828965; cv=none; d=google.com; s=arc-20160816; b=iMm15qm4SvASHDOHow9E71TVcLzMEWAoFYSiBG2IVPvsRpIjnzgemVSDFuuKXtOKMl 1XYYL9YupMdQGAi6H6tyspf4DgRCDD7brI0QS1+IVKn3rDzJhqo1gE71sLjZCqmvnDdG o6hpnzOv27OHXA0G/AR0OdEEMJ7bn1LZlP5Lda1m2JNHXloZi9NZKBE97dFUuSOmwKtT KkJfVpLaBmDnZmpNfOSEHjYvQRFRr3VaQgsMLMeeNPdr87V8jtrJLlisdHEgrt3NuU25 AlZeMARa+V182ZAMAiiufOAoD1YlFihvg7/LX10Znvch1ANNFwW/Vvzp4Ue/IA7BYv6t dSXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Wm1pRBo+SMYVYGZwP3OH0M1CCB3JsS0S2iataXnd3eI=; b=cTYQ3OaZNgO9h8a/yfooZHCiA0d3jQZ6RwWkV74RyIh/ToB8I/zDphFgGQDuqCT4nT 0JPFfMeVTiVrtXK7GcQRj0Cmd9N/NgnS+3dtJAiQgj1H3OkiyBZ375niIUegdmQa7GOp YLFmQVi78t4M1NHaL9zATkOpDf+o6WYI0OaTdDYl2F7db5ZVRgiMYnH1tuxI6/GXSC4E v19r1/Fc7ilCyJfqRTt+OuXaViP/PrK0J1mA/M5NyxJpuDjr07BOoiFqvGSfL4wCAn0w 5ww4nSCTehMdtiPW+e7jmJ3gXKBxpkC+VHWGRkwhbSGndAdyj3yQnnaJ8b33rUeCUoQW oWFQ== 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 cb10si4989092edb.420.2020.07.26.22.49.03; Sun, 26 Jul 2020 22:49:25 -0700 (PDT) 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 S1726728AbgG0Fq3 (ORCPT + 99 others); Mon, 27 Jul 2020 01:46:29 -0400 Received: from verein.lst.de ([213.95.11.211]:42025 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgG0Fq3 (ORCPT ); Mon, 27 Jul 2020 01:46:29 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 398D768B05; Mon, 27 Jul 2020 07:46:26 +0200 (CEST) Date: Mon, 27 Jul 2020 07:46:25 +0200 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, "H. Peter Anvin" , Song Liu , Linus Torvalds , linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 18/23] init: open code setting up stdin/stdout/stderr Message-ID: <20200727054625.GA1241@lst.de> References: <20200714190427.4332-1-hch@lst.de> <20200714190427.4332-19-hch@lst.de> <20200727030534.GD795125@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727030534.GD795125@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 04:05:34AM +0100, Al Viro wrote: > On Tue, Jul 14, 2020 at 09:04:22PM +0200, Christoph Hellwig wrote: > > Don't rely on the implicit set_fs(KERNEL_DS) for ksys_open to work, but > > instead open a struct file for /dev/console and then install it as FD > > 0/1/2 manually. > > I really hate that one. Every time we exposed the internal details to > the fucking early init code, we paid for that afterwards. And this > goes over the top wrt the level of details being exposed. > > _IF_ you want to keep that thing, move it to fs/file.c, with dire comment > re that being very special shite for init and likely cause of subsequent > trouble whenever anything gets changed, a gnat farts somewhere, etc. Err, while I'm all for keeping internals internal, fd_install and get_unused_fd_flags are exported routines with tons of users of this pattern all over.