Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp729340ybg; Sun, 26 Jul 2020 20:06:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP7ZdNUGbCBeG8op3pA0s213SrRawj/yHYoHn0RYkO8ZJULCzE8/VcbmjhtBYTlmHOG0qI X-Received: by 2002:a17:906:82d5:: with SMTP id a21mr18566028ejy.213.1595819203029; Sun, 26 Jul 2020 20:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595819203; cv=none; d=google.com; s=arc-20160816; b=RSsRcTtvPNs8473/oVwC550LOP8pnwIHZ4RN0T/Ak6xpp5xrOauKOpyjQm08m4SYO0 7j2ZiSPxQllm1QWZsAMdsOKeVyvhzcAy6e+n4K3CNy60QyEg/2AoKCmkwkq14TDQbi4x yCPv6IglCgC6wN0GWpzOwaymOjMNee7c2afxenQRWEll6Jt/wXRpVdpcxXp/PrtTjxVk d0lsdoGG1gg19eQimoS9IUft5dAq2peySTXz9E9FNnZRYzQuw/Ukr3gEW73Cd3GIE8No cXg5/2WpHcHvsksEohM+LcUXNEemb6ZdnWmBx24ft0Ln2+3oVJ77gxQTY5x5/KOtMPrT s0xg== 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=UPLBl7qU3zReOWf9ZnWmqe6C1ba8poh3n0dAXffm51I=; b=KNzukurgWrK3MV6qSiCobB1G/gDcQknodHTBw16fuLHrrbVH32T6g55nkTPf2JGxms 9KhRwFi0R6iF+X9CbDDh/J/ZDLV9uJH8K+LYzm2YsW79LSbDtdfmDQTkKeBXr8+r2JdO BdrnZf6GxMc/AyYMPo1wRxjktF734bG3TyXQvmyyKFz+EXKJMhocCYE00SY82VWK1ZjO zBfWC0pktMYWQ2QcKD9OcSjhsuEe2eq76KjsKa++3nj5gEC50obqAmrxMeqSmqHTwYOt yk6pdnDdFPg3D1e92+TdQ8aQiqpvevegRGNyViOp7lm+LfwYO0yEGvU60g8av8mnvYU1 J0mw== 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 bu5si5051096edb.553.2020.07.26.20.06.21; Sun, 26 Jul 2020 20:06:43 -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 S1727772AbgG0DFh (ORCPT + 99 others); Sun, 26 Jul 2020 23:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgG0DFh (ORCPT ); Sun, 26 Jul 2020 23:05:37 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BE1CC0619D2; Sun, 26 Jul 2020 20:05:37 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jztSI-003Nid-Qc; Mon, 27 Jul 2020 03:05:35 +0000 Date: Mon, 27 Jul 2020 04:05:34 +0100 From: Al Viro To: Christoph Hellwig Cc: 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: <20200727030534.GD795125@ZenIV.linux.org.uk> References: <20200714190427.4332-1-hch@lst.de> <20200714190427.4332-19-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200714190427.4332-19-hch@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Do not leave that kind of crap sitting around init/*.c; KERNEL_DS may be a source of occasional PITA, but here you are trading it for a lot worse one in the future.