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 92CFDC433E3 for ; Mon, 27 Jul 2020 03:05:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78798206D8 for ; Mon, 27 Jul 2020 03:05:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbgG0DFh (ORCPT ); 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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.