Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp5056846pjb; Mon, 27 Jul 2020 11:48:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH6h9V4Mfw5QQMeVI9Gu05aLUQcRObLxHmHBox8Tx/lPAmWqQUgPsqwjqTfnuu4xpydWPa X-Received: by 2002:a50:d4cc:: with SMTP id e12mr11438337edj.143.1595875687129; Mon, 27 Jul 2020 11:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595875687; cv=none; d=google.com; s=arc-20160816; b=CwYYqyy9+56uKiNMIVUOOxHRnVzPx6+QqihddCQSGOsCSZ/OZ4JBKY2vXzE3XK5mYq 2aEsz81lqAbErWXXy00MwcbPnyRbjF/UTA4mZClulNSHuQbxpsAUAovkgx4Q3SdNoba4 d3ILV2IIfprP28B8TsIGGMcoQVjVuAgrxtXBkRx4w7kSZ0eyKm0OpgccCqxK2Nlbtkad HyUngzlHzEtBafL1FYDL0ZhAUJeRNNFbWQ0yt/H1z6I4+kGSbYuqikbyY6pUQyK1lhSP WKv5TtWCZ0xK3lZwSMYNlwGaPKW+E2SyNUJfj1FaIMSHbkOquDw2XgvZSJmjaL/lIkIA y3cA== 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=kz5pnQd1vVAcXyj7oQz8a/AYsrk9FwpuRbpfgYHv+8c=; b=avgaF+DYnI06XMSUjD6Op2/g1uOgh91kbv8v7KzeQOseyHA7Nj3zLNsOYwWrpChLvM BvL6TZMOaTEKlR0glZXohIdLlziUB+dYiLOpwr3+SQKQZ6HV+noAOxtHYp/1rxnLOtQL ulmUVjyGBqY//qfqeIH1bp4crmfl5236ICjTjutbi2R5rI1s/S2pj3L3ZRtuvr7NEGYW jBgWE6IbG7Ao+A5Emg21gfWW3qng4MBeKtALvjm/JNIXbHNmBWWgfjDb0m32E2le4bcx K16bXaaPEMD4k0+J8CpN5PR8V3YpNYAATzFIaa7R19srUzg50ynVndBEAmCMkBABTWup ftSg== 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 cx25si5864815edb.75.2020.07.27.11.46.36; Mon, 27 Jul 2020 11:48:07 -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 S1731038AbgG0PzB (ORCPT + 99 others); Mon, 27 Jul 2020 11:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728466AbgG0PzA (ORCPT ); Mon, 27 Jul 2020 11:55:00 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 654A3C061794; Mon, 27 Jul 2020 08:55:00 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k05Sn-003kD8-JD; Mon, 27 Jul 2020 15:54:53 +0000 Date: Mon, 27 Jul 2020 16:54:53 +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: <20200727155453.GE794331@ZenIV.linux.org.uk> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727064828.GA2317@lst.de> 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 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.