Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp821716ybg; Sun, 26 Jul 2020 23:49:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylNlHdHjnG9rcsM6P2W5Sp1Yl80Zj1Klt3JE046Lf26qnS6sxJVe11fWwrV9hVMH/yjMrK X-Received: by 2002:aa7:d283:: with SMTP id w3mr20007378edq.76.1595832557071; Sun, 26 Jul 2020 23:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595832557; cv=none; d=google.com; s=arc-20160816; b=yhxdhuBz1vT5inJyKG2iKoVBqemDym3DPsJfK8RFONnvrfY6Jh7FOh4Ad0bf3Tgr7N vmjeem9sXEenZAdAhwbOKgRbBXNxghmCqcKnkyoo47Zfy6UP9B8Hcq8iGlml/Ks3F4zI /NJ91ewnRojl8h3TriTs825jYFSLibgCbvbLil/XUFWILNtmaE8gtNt2NVT6ozpdUkZq Mp0yNcmZ4CnH+aYybC+iL4hkHkBkkgVoFA45xmWm9sJSoDWMPf0EmwChJgNGk1NTHLNI oWYrMWyUOCbbX9x8EIit16cKQhLi5c+7H+FqTA+uEp03rlz/OWY9z3WhmPApmIgOQVX8 oNcg== 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=6NY9XhdW3lUx0anZmjc4G1OhEJdZzpnHUWs10JY97iE=; b=CIB0NBawVBu9qFP2AIS0YT4zGhNB9/Gnzyv7XNW2F/Z/oqOE96YXeAMe1OsD7dCM4M d6JgyTZZX7dAQluNTwamxmX5a/4TorpIlqy7wbGUYVy0B+BsG4BM7La5ftff9MEfy8Ys iGuDnrKRqU9ye4bSj48eEatDievts69i3Mn7LXmXYpWtPfkt0hAhCqdSXNJpqgWhYKbo hDyFehwKri07swNq5AqRmguMiDBVu+QOZXnAXmgQtJw5dx85Z+lLFIsFDn41q6U/RrJM h0iw4u2R056IaViQA1utD3vNyke6lSOX58eBDkNHZQq2aq9KwJGc/fmHPV4bisRgt4RT U2bA== 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 q3si128923ejn.39.2020.07.26.23.48.54; Sun, 26 Jul 2020 23:49:17 -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 S1726278AbgG0Gsb (ORCPT + 99 others); Mon, 27 Jul 2020 02:48:31 -0400 Received: from verein.lst.de ([213.95.11.211]:42214 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbgG0Gsb (ORCPT ); Mon, 27 Jul 2020 02:48:31 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 1B28068B05; Mon, 27 Jul 2020 08:48:29 +0200 (CEST) Date: Mon, 27 Jul 2020 08:48:28 +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: <20200727064828.GA2317@lst.de> References: <20200714190427.4332-1-hch@lst.de> <20200714190427.4332-19-hch@lst.de> <20200727030534.GD795125@ZenIV.linux.org.uk> <20200727054625.GA1241@lst.de> <20200727060322.GC794331@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727060322.GC794331@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 07:03:22AM +0100, Al Viro wrote: > On Mon, Jul 27, 2020 at 07:46:25AM +0200, Christoph Hellwig wrote: > > 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. > > get_file_rcu_many()? All over the place? Besides, that's _not_ the normal > pattern for get_unused_fd() - there's a very special reason we don't expect > an error from it here. Oh well. I can add an init_dup2, but that should probably go after the series adding fs/for-init.c or fs/init.c. I'll skip it for the current set of fixups and will send it once we have a stable branch for that.