Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp5056839pjb; Mon, 27 Jul 2020 11:48:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBB8ES5mAH5g8rwk8yqmcYXTrSfiITEEjZ/kWxsSiPCVP2N/0Fts1/r/QZsZZKT2TADqX4 X-Received: by 2002:a17:906:7291:: with SMTP id b17mr4022470ejl.25.1595875686821; Mon, 27 Jul 2020 11:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595875686; cv=none; d=google.com; s=arc-20160816; b=KMN/uF+aijvKiMj+INbwDaDIJnCVOudKLKgbo9NYrxqw9FiKVZq6sL3JvrdqLFWqq9 voiC4EeBAUrDrerNzO74d1uzZHziJry82gucrDyvjhMP7TMZx7FgeHq5oR96Gt5+ALXz Ftg3sM3WZLHWMo06H5BfmGFBP2E7EFiaQ19rJcBWRoQMktR5FQkHyYQUNWWfswyI3DKM fs0xCasZaafc2Ld0SI6oh3Z6+q4EhxaGCGnnZDqylrSR9AL6JhE0kCoOkEc6GzNGRSNJ ChYI4A37nNb03Z03yWuP6pe0vwdF3ArcNY1yG6PFo6+za00Y5MfTjuxEbXQ+6F/plSW/ Z4mQ== 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=TChyz5SKrKPHfDl5jIUsk8llEGO+nahVm7cLD21OUQE=; b=TAAByDib+k4O34ghYT4fQ7BqjbW2whJBHkZ54bHP8QGrKCz00ARy15qqpGVCTB04Nj 17c9zqRrUePzcIQNKeL4Jzkax+83c0l5JIA1l57ztXaYHvZPJglf6C1XQF5PnARO8ukb D/27JyehvfgHEabTpI2KF8NIc7M3iQMY5u+o2PZqMymRJV0/BD7BnUaWUB+ymLJ3qHi2 JrRvwqGTLa58oXVXlAqOuIG1l6BB/Cuzhp6SVUnPcJ6XxmS8OfSGPOW/rABS5cSvKwac hbvUBnY7NcKIW10zCVfgvk2GAPUYSt+6iL7yj1B20RnpA6vKLlmVy846s3MthDDShQJL FZ0Q== 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 w18si6062131eds.406.2020.07.27.11.46.55; Mon, 27 Jul 2020 11:48:06 -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 S1727923AbgG0P6d (ORCPT + 99 others); Mon, 27 Jul 2020 11:58:33 -0400 Received: from verein.lst.de ([213.95.11.211]:44198 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727097AbgG0P6c (ORCPT ); Mon, 27 Jul 2020 11:58:32 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 91E3C68B05; Mon, 27 Jul 2020 17:58:29 +0200 (CEST) Date: Mon, 27 Jul 2020 17:58:29 +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: <20200727155829.GA7225@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> <20200727064828.GA2317@lst.de> <20200727155453.GE794331@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727155453.GE794331@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:54:53PM +0100, Al Viro wrote: > On Mon, Jul 27, 2020 at 08:48:28AM +0200, Christoph Hellwig wrote: > > 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. > > OK. The really serious ones are around f_pos uses and d_genocide() one. > FWIW, cleanup_rootfs() should probably be removed - it looks rather > pointless. I've got all that in a series I've tested this morning, and which I really should post now..