Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp802065ybg; Sun, 26 Jul 2020 23:03:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyrBxQZN+LtHtlyWMtmI6aaYQzj/Wo7PTE1+ng3MmxuHzg0evjcW/Z4p6cQJIFCxiIJQ6o X-Received: by 2002:a50:8fc4:: with SMTP id y62mr19162075edy.170.1595829839562; Sun, 26 Jul 2020 23:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595829839; cv=none; d=google.com; s=arc-20160816; b=u24zFkmp4MsH3TRI94YeYIJva1E0k8cY95yUsr4MB8qjLtcyXlSCn5PyItqoFaxYej jFPDx0qWQae4CcQBkSPLpgqFSLAzLg+yFNPAoFvZeJEr+Gfa1OT8bJxCyEStSQeF8gSx VFTI/EL9fpqkWP0MuVqF9EsKh2V+aALk9PR2wVxojrxErRFvU6+mUdRj7NLrgwp8SxYI x/uOjrG4Oavhl/oGTQqBPguzPXGPqMIdiN/yIS8hIKbKUYVhWSskWKS219Yrm4OL4aam UXV2lS8IV3EZGY+nWRG9KsYx7SSTGRJriSl05zgYSGZETwDXhicwJpDaLJbF1NK5heSH ktwg== 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=tKwe3tWQA9qYV6jenHrGdj/4m3SdXm7PydYOQVH7moQ=; b=vynGjdEd2Hs55sbipVRBaF5DsmkW/V8hACteue8FQiGF/ZyC/h/Lytj8cwAzVBLbvi ATDx365OJcP6hnQir4+8NNhM4g7qXHeEQQF+3QzaPN9miBeaewIoKY2t/oyTfYYFbv5R iKrI2hQ//uScGjIvQOzGRUZdpA92mF1Q+YZqY6OQNPtspHro6spAnfjMeveOu/p2yggS Z5p+QNaEZ5nR0Wcj+9tjpRAGEfyeqpfH4FfVoptnQJiPtfgGyud/CSBXf2aD+Dv/6jCc /V8MABgR4zRL9yQXFbqUPQSmlAju/jMz85w2qPavGuHOR7nd/c5cSY/QXVm/80iCxfOG r0AA== 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 g10si5491263ejf.312.2020.07.26.23.03.36; Sun, 26 Jul 2020 23:03:59 -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 S1726215AbgG0GD0 (ORCPT + 99 others); Mon, 27 Jul 2020 02:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgG0GD0 (ORCPT ); Mon, 27 Jul 2020 02:03:26 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCF51C0619D2; Sun, 26 Jul 2020 23:03:25 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzwEM-003Shs-JO; Mon, 27 Jul 2020 06:03:22 +0000 Date: Mon, 27 Jul 2020 07:03:22 +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: <20200727060322.GC794331@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727054625.GA1241@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 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.