Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4703554pxj; Tue, 25 May 2021 14:25:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHAHrwbeiloEzvoh0UPbwvDPJsqRVaOl10YoE7pfyNmxF4IVnhQ8lshod0fLnfTyYkimq2 X-Received: by 2002:a02:83c2:: with SMTP id j2mr33119738jah.6.1621977912794; Tue, 25 May 2021 14:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621977912; cv=none; d=google.com; s=arc-20160816; b=GcNM6CBNB+D74BsGxaUSU2f99xDRekDQgeiFXPTSe66Bxl/JRUK9OUF/Wj1lu8ISFp LjJj0keir7Xkb5jYNhKsYBOr3gg9wMUO9r3SkdveYCdhGN3KXb80QfvBuiSvyKe4GWqO VWfxYobKefKyln8K9/IumQTNHnGPniEoZ0C9hG9uenUTAIGco64aO4e+LQbrR9Gx3k2B 39iAcINFgTU2L8scxso0e8qqvRShM/3zLM7TAn+fgiJFvxCho5l/PTlYDQqiQ2B3z58o iOUJM6lR2CLtL8JPO1SFuP0BToghjthmkggqCLZN4VxKd7BOSu6v1Wb5gx6USikHyUkh Gt3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=9LT36c+v7f+jtvZeqVJyWZWGDhs30VSCyLh4NXJRoH4=; b=0ESKElkRPFpeLSmSj3t9/QAYv8k3Yy0bBgGUPZ49FSnk8kPw/mfNl+aopJzuoeITWS b9Eta+rE0+GgNqBRsHmR/DyerTRUDEcA+NlQ3pu61rk47cSeQYu056oCGGXIpAPiGbB1 dFf+ORtHBgdagzHmQRkYknKz9uCpInm+Zfzt0E0e0bUTzaikwaGZlE3QcllAGx5AN2M0 kDOvrLI1Q1K8dKRS5xMRll+jkPkPYknp/7d4akYV/WojE78dhMy86k6h+BNwsx4EWXV0 ABVqeUTCIW3HrZEfZRCvUay6KPJf/68b+X5R1lDzsmLTvqjpLqAaO8XcprONFm7zrHF/ 8yAA== 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 j5si6077715iom.105.2021.05.25.14.24.59; Tue, 25 May 2021 14:25:12 -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 S232573AbhEYRp3 (ORCPT + 99 others); Tue, 25 May 2021 13:45:29 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:48705 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231346AbhEYRp2 (ORCPT ); Tue, 25 May 2021 13:45:28 -0400 Received: (Authenticated sender: josh@joshtriplett.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 4E2F940005; Tue, 25 May 2021 17:43:42 +0000 (UTC) Date: Tue, 25 May 2021 10:43:41 -0700 From: Josh Triplett To: menglong8.dong@gmail.com Cc: mcgrof@kernel.org, viro@zeniv.linux.org.uk, keescook@chromium.org, samitolvanen@google.com, ojeda@kernel.org, johan@kernel.org, bhelgaas@google.com, masahiroy@kernel.org, dong.menglong@zte.com.cn, joe@perches.com, axboe@kernel.dk, hare@suse.de, jack@suse.cz, tj@kernel.org, gregkh@linuxfoundation.org, song@kernel.org, neilb@suse.de, akpm@linux-foundation.org, f.fainelli@gmail.com, arnd@arndb.de, linux@rasmusvillemoes.dk, wangkefeng.wang@huawei.com, brho@google.com, mhiramat@kernel.org, rostedt@goodmis.org, vbabka@suse.cz, glider@google.com, pmladek@suse.com, chris@chrisdown.name, ebiederm@xmission.com, jojing64@gmail.com, terrelln@fb.com, geert@linux-m68k.org, mingo@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, jeyu@kernel.org Subject: Re: [PATCH v2 0/3] init/initramfs.c: make initramfs support pivot_root Message-ID: References: <20210525141524.3995-1-dong.menglong@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210525141524.3995-1-dong.menglong@zte.com.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021 at 10:15:21PM +0800, menglong8.dong@gmail.com wrote: > From: Menglong Dong > > As Luis Chamberlain suggested, I split the patch: > [init/initramfs.c: make initramfs support pivot_root] > (https://lore.kernel.org/linux-fsdevel/20210520154244.20209-1-dong.menglong@zte.com.cn/) > into three. > > The goal of the series patches is to make pivot_root() support initramfs. > > In the first patch, I introduce the function ramdisk_exec_exist(), which > is used to check the exist of 'ramdisk_execute_command' in LOOKUP_DOWN > lookup mode. > > In the second patch, I create a second mount, which is called > 'user root', and make it become the root. Therefore, the root has a > parent mount, and it can be umounted or pivot_root. > > In the third patch, I fix rootfs_fs_type with ramfs, as it is not used > directly any more, and it make no sense to switch it between ramfs and > tmpfs, just fix it with ramfs to simplify the code. > > Changes since V1: > > In the first patch, I add the flag LOOKUP_DOWN to init_eaccess(), to make > it support the check of filesystem mounted on '/'. > > In the second patch, I control 'user root' with kconfig option > 'CONFIG_INITRAMFS_USER_ROOT', and add some comments, as Luis Chamberlain > suggested. > > In the third patch, I make 'rootfs_fs_type' in control of > 'CONFIG_INITRAMFS_USER_ROOT'. This looks much better, thank you; this addresses all my concerns with v1. I appreciate having the config option to control this as well.