Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp213624pxj; Fri, 28 May 2021 02:06:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHL86OVFk6KY2SRm7nMQGvJzdODsOiaQ14CMvrZKKmAxMrczpsn+k9UR+xYwuGN5ruwo4S X-Received: by 2002:a05:6402:15:: with SMTP id d21mr8888390edu.66.1622192792884; Fri, 28 May 2021 02:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622192792; cv=none; d=google.com; s=arc-20160816; b=jw+gnthNVwmZ7E9vPmAT+64rfkx4zM++GkUZd6MQ8cQEkNElfbuUCObxXdreTM3OQ5 lMll8FmFs9dDwz2m0IXBhxGjD+hHZEMAKBY+iH8ugYJqGXh+k778IEinoWsnbMRmpOFd M1XCPUNRVpLk0ERX58hlVFAbONFy1+1U1gxPuwgIQQIhAX7tsmfseEHKHM6GP6tuksAc fmffISj2E54TknWf5m5bi1aYWo7eiRBp8kPTZygnly28rSSC2714hoK2UvkqpFW+Vohv ip2x1v+Cd3WH0Fqjs5yhbnGzA9wZqSFPVcO7Wj1HA2iLpCN+15O3hTMQ/vwv45Vw7LT1 Gz+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8ONSQ40tIX1ptfs2rDe/1Z7im0fRwlSIOjAYodAV+kg=; b=I+ddnifIcy5YrpPWHquoXBf3UD7bObxy+zIhrMovk82XJLVQi7CqfZiFSEKpWDlgtK 9hGaKrr1ylCAIRAaaRy5YlkMsbL4L4+oiaf2687Y32RByicO/xtU38gxkTJS43whshl1 bCESxkL2GE4EUooU6BhTPiK58ST4OuXP8EQogpdT0/Qm4ZvPdoplIqFwd5hItAezT9p2 8hwZqDM0+IoIwIUNnf/n4ghv8Q5uDFgsf80MboqA+q/1sTIL0WTABLFnJLG9SfQNX0bt HRwACml+CdF5fecDcTDeAjcaCdhYdFRR9G8nV3lMknLo+wTpY1nVsQLMuzREQWHJYdSU Umjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j8cy13Ug; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si5607612ejs.86.2021.05.28.02.06.07; Fri, 28 May 2021 02:06:32 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j8cy13Ug; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234497AbhE1Hiy (ORCPT + 99 others); Fri, 28 May 2021 03:38:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbhE1Hix (ORCPT ); Fri, 28 May 2021 03:38:53 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D22AC061574; Fri, 28 May 2021 00:37:19 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id c15so4041348ljr.7; Fri, 28 May 2021 00:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8ONSQ40tIX1ptfs2rDe/1Z7im0fRwlSIOjAYodAV+kg=; b=j8cy13UgmiAo40bozT8Y7ei8oSr3b/Lanx19OnthKFxwgaZHcP9ON3iG/gEln8f4Q7 2MAxPRJ+JcQBvd9moH8Sw9yOYzlBdMJ7Lg9oh6ZSlR5ybiRRSBAtDMZOtvXRsPKwVNWC 0RvHBJ8+rZQ8QKEY49wFatP5C9mvB64+K4EwQ9x4km4ibccuCnCiy6ezKuNxwPcYZPeZ Wbikl+sew11fe4nTD2Swlw8fZ32P6l+QCKIRIW0GixoAPeiv52k/J+VOxZsfHoWMuPIj U2HUsOUQ9F+nO2qbhzAvxqH6APXyXbQpvuk7WonfAZS5qhPc1iVYBLNYn3Cy10CFER/+ nS+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8ONSQ40tIX1ptfs2rDe/1Z7im0fRwlSIOjAYodAV+kg=; b=UxOYXbgmohDw4tTvRklmLVNssrTSHIovmRNWSeB5MpWTGF39NzNzgL0NIVvvf9Ryd3 eZn8RVRaN5gx9bJN6KAk/K+FdCq4G8sH1e4pftz+vS+qZkUMqj0U1/JVnpkjBKsf06Me 5SnGxpyD2imh8/xn50AOsOZPDSwGD9EGmdkNM2m4dhtO1zuKsUO8QHB8bQDrct0SdXW9 diH9trknnMLIOGRCA3/JyDVqxDcXcbwO9n/ThECop3www/8yGhiy/KOfVDjjhmIF7OZf bj98opbxS9J+ikdczK9zRYf/CaLcQn8AvdT324At/hGb8mh0KgO5cB1vFFNRTWDWsHeW jMQg== X-Gm-Message-State: AOAM532eTOnZR6Ch6nh8glo/Qps2/UqlZoKbLIs35v694bwaUzIQr3zS 9vWsQijdKbsuPVp/gKNJdnWXFPOKPu5TypgYxQE= X-Received: by 2002:a2e:99cd:: with SMTP id l13mr5545313ljj.89.1622187437475; Fri, 28 May 2021 00:37:17 -0700 (PDT) MIME-Version: 1.0 References: <20210525141524.3995-1-dong.menglong@zte.com.cn> <20210528161012.c9c8e25db29df3dbc142c62e@kernel.org> In-Reply-To: <20210528161012.c9c8e25db29df3dbc142c62e@kernel.org> From: Menglong Dong Date: Fri, 28 May 2021 15:37:04 +0800 Message-ID: Subject: Re: [PATCH v2 0/3] init/initramfs.c: make initramfs support pivot_root To: Masami Hiramatsu Cc: Luis Chamberlain , Josh Triplett , Alexander Viro , Kees Cook , Sami Tolvanen , ojeda@kernel.org, johan@kernel.org, Bjorn Helgaas , masahiroy@kernel.org, Menglong Dong , joe@perches.com, Jens Axboe , hare@suse.de, Jan Kara , tj@kernel.org, gregkh@linuxfoundation.org, song@kernel.org, NeilBrown , Andrew Morton , f.fainelli@gmail.com, arnd@arndb.de, Rasmus Villemoes , wangkefeng.wang@huawei.com, Barret Rhoden , Steven Rostedt , vbabka@suse.cz, Alexander Potapenko , pmladek@suse.com, Chris Down , "Eric W. Biederman" , jojing64@gmail.com, terrelln@fb.com, geert@linux-m68k.org, mingo@kernel.org, linux-fsdevel@vger.kernel.org, LKML , jeyu@kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On Fri, May 28, 2021 at 3:10 PM Masami Hiramatsu wrote: > > Hi, [...] > > > This idea sounds good to me. I have tested it with MINCS container shell > script (https://github.com/mhiramat/mincs). > > However, I found different issue on init_eaccess() (or symlink lookup) > with this series. > > I'm using a busybox initramfs, and it makes /init as a symlink of "/sbin/init" > (absolute path) > > When CONFIG_INITRAMFS_USER_ROOT=n, it booted. But CONFIG_INITRAMFS_USER_ROOT=y, > it failed to boot because it failed to find /init. If I made the /init as > a symlink of "sbin/init" (relative path), it works. > > Would you have any idea? > Thanks for your report! I think it's because of the path lookup on '/'. With LOOKUP_DOWN set, the lookup for '/' of '/init' will follow the mount. However, during the follow link of '/sbin/init', the '/' of it will not be followed, because LOOKUP_DOWN only works one time. I'm not sure if this is an imperfection of 'path_lookupat()'. I'll fix it in the next series. Thanks! Menglong Dong